別のキーワード
ライブラリ
- ビルトイン (162)
- delegate (36)
- forwardable (48)
- json (24)
-
rdoc
/ code _ object (12) -
rdoc
/ context (12) - win32ole (12)
クラス
- Delegator (36)
- Module (72)
- Object (84)
- Proc (6)
-
RDoc
:: CodeObject (12) -
RDoc
:: Context (12) -
WIN32OLE
_ TYPE (12)
モジュール
キーワード
-
def
_ delegators (24) -
def
_ instance _ delegators (12) -
def
_ single _ delegators (12) -
default
_ event _ sources (12) -
instance
_ methods (12) -
private
_ instance _ methods (12) -
private
_ methods (12) -
protected
_ instance _ methods (12) -
protected
_ methods (24) -
public
_ instance _ methods (12) -
public
_ methods (24) -
remove
_ methods _ etc (12) -
ruby2
_ keywords (18) - send (24)
-
set
_ visibility _ for (12) -
singleton
_ methods (12) -
to
_ json (12) -
to
_ json _ raw _ object (12) -
undef
_ method (12)
検索結果
先頭5件
-
RDoc
:: CodeObject # remove _ methods _ etc -> () (15202.0) -
何もしません。RDoc::CodeObject#document_self= に false を指定した 時のコールバックとして呼び出されます。オーバーライドして使用します。
...何もしません。RDoc::CodeObject#document_self= に false を指定した
時のコールバックとして呼び出されます。オーバーライドして使用します。... -
Module
# instance _ methods(inherited _ too = true) -> [Symbol] (12380.0) -
そのモジュールで定義されている public および protected メソッド名 の一覧を配列で返します。
...で定義されている public および protected メソッド名
の一覧を配列で返します。
@param inherited_too false を指定するとそのモジュールで定義されているメソッドのみ返します。
@see Object#methods
//emlist[例1][ruby]{
class Foo
private; def......ected_foo() end
public; def public_foo() end
end
# あるクラスのインスタンスメソッドの一覧を得る
p Foo.instance_methods(false)
p Foo.public_instance_methods(false)
p Foo.private_instance_methods(false)
p Foo.protected_instance_methods(false)
class Bar < Foo
end
//}......実行結果
[:protected_foo, :public_foo]
[:public_foo]
[:private_foo]
[:protected_foo]
//emlist[例2][ruby]{
class Bar
private; def private_foo() end
protected; def protected_foo() end
public; def public_foo() end
end
# あるクラスのインスタンスメ... -
Module
# private _ instance _ methods(inherited _ too = true) -> [Symbol] (12326.0) -
そのモジュールで定義されている private メソッド名 の一覧を配列で返します。
...ます。
@see Object#private_methods, Module#instance_methods
//emlist[例][ruby]{
module Foo
def foo; end
private def bar; end
end
module Bar
include Foo
def baz; end
private def qux; end
end
Bar.private_instance_methods # => [:qux, :bar]
Bar.private_instance_methods(false) # => [:q... -
Module
# protected _ instance _ methods(inherited _ too = true) -> [Symbol] (12314.0) -
そのモジュールで定義されている protected メソッド名 の一覧を配列で返します。
...そのモジュールで定義されている protected メソッド名
の一覧を配列で返します。
@param inherited_too false を指定するとそのモジュールで定義されているメソッドのみ返します。
@see Object#protected_methods, Module#instance_methods... -
Delegator
# protected _ methods(all = true) -> [Symbol] (12308.0) -
そのオブジェクトが理解できる protected メソッド名の一覧を返します。
...そのオブジェクトが理解できる protected メソッド名の一覧を返します。
@param all 偽を指定すると __getobj__ のスーパークラスで定義されたメソッドを除きます。
@see Object#protected_methods... -
JSON
:: Generator :: GeneratorMethods :: String # to _ json _ raw _ object -> Hash (12101.0) -
生の文字列を格納したハッシュを生成します。
...はなく生の文字列を JSON に変換する場合に使用してください。
require 'json'
"にほんご".encode("euc-jp").to_json_raw_object
# => {"json_class"=>"String", "raw"=>[164, 203, 164, 219, 164, 243, 164, 180]}
"にほんご".encode("euc-jp").to_json # source sequence is... -
JSON
:: Generator :: GeneratorMethods :: Object # to _ json(state _ or _ hash = nil) -> String (9007.0) -
自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。
...][ruby]{
require "json"
class Person
attr :name, :age
def initialize(name, age)
@name, @age = name, age
end
end
tanaka = Person.new("tanaka", 29)
tanaka.to_json # => "\"#<Person:0x00007ffdec0167c8>\""
tanaka.method(:to_json).owner # => JSON::Ext::Generator::GeneratorMethods::Object
//}... -
RDoc
:: Context # set _ visibility _ for(methods , visibility , singleton = false) -> () (6424.0) -
methods で指定した RDoc::AnyMethod、RDoc::Attr の内、 singleton で指定した条件と一致するメソッドすべての可視性を visibility に設定します。
...
methods で指定した RDoc::AnyMethod、RDoc::Attr の内、
singleton で指定した条件と一致するメソッドすべての可視性を visibility
に設定します。
@param methods RDoc::AnyMethod、RDoc::Attr オブジェクトの配
列を指定します。
@param vi......sibility 可視性を :public, :protected, :private の内のいずれか
で指定します。
@param singleton 特異メソッドの可視性を変更する場合は true、そうでない
場合は false を指定します。... -
Module
# ruby2 _ keywords(method _ name , . . . ) -> nil (6382.0) -
For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.
...For the given method names, marks the method as passing keywords through
a normal argument splat. This should only be called on methods that
accept an argument splat (`*args`) but not explicit keywords or a
keyword splat. It marks the method such that if the method is called
with keyword argument......other method call, and that method call does not include explicit
keywords or a keyword splat, the final element is interpreted as
keywords. In other words, keywords will be passed through the method to
other methods.
This should only be used for methods that delegate keywords to another
method, an......d only for backwards compatibility with Ruby versions before
2.7.
This method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist in Ruby versions
before 2.7, check that the module responds to this method before calling
it. Also, be aware that...