るりまサーチ

最速Rubyリファレンスマニュアル検索!
174件ヒット [1-100件を表示] (0.033秒)
トップページ > クエリ:method[x] > クエリ:Method[x] > クエリ:Extend[x]

別のキーワード

  1. irb/input-method new
  2. irb/input-method gets
  3. _builtin define_method
  4. irb/input-method encoding
  5. irb/input-method readable_atfer_eof?

検索結果

<< 1 2 > >>

JSON::Ext::Generator::GeneratorMethods::String::Extend (24016.0)

Alias of JSON::Generator::GeneratorMethods::String::Extend

...Alias of JSON::Generator::GeneratorMethods::String::Extend...

JSON::Generator::GeneratorMethods::String::Extend (24000.0)

String に JSON で使用する特異メソッドを追加するためのモジュールです。

String に JSON で使用する特異メソッドを追加するためのモジュールです。

ERB::DefMethod.#def_erb_method(methodname, erb) -> nil (18420.0)

self に erb のスクリプトをメソッドとして定義します。

...をメソッドとして定義します。

メソッド名は methodname で指定します。
erb が文字列の時、そのファイルを読み込み ERB で変換したのち、メソッドとして定義します。

@param methodname メソッド名

@param erb ERBインスタンスもしく...
...はERBソースファイル名

例:

require 'erb'
class Writer
extend
ERB::DefMethod
def_erb_method('to_html', 'writer.erb')
...
end
...
puts writer.to_html...

IRB::ExtendCommandBundle.irb_original_method_name(method_name) -> String (15460.0)

method_name で指定したメソッドの irb 中でのエイリアスを返します。ライブ ラリ内部で使用します。

...
method
_name で指定したメソッドの irb 中でのエイリアスを返します。ライブ
ラリ内部で使用します。

@param method_name メソッド名を Symbol か文字列で指定します。

@see IRB::ExtendCommandBundle#install_alias_method...

IRB::ExtendCommandBundle#install_alias_method(to, from, override = NO_OVERRIDE) (15202.0)

メソッドのエイリアスを定義します。ライブラリ内部で使用します。

...のメソッドを
上書きするかどうかを
IRB::ExtendCommandBundle::NO_OVERRIDE、
IRB::ExtendCommandBundle::OVERRIDE_PRIVATE_ONLY、
IRB::ExtendCommandBundle::OVERRIDE_ALL のいずれか
で指定します。...

絞り込み条件を変える

Object#singleton_methods(inherited_too = true) -> [Symbol] (12212.0)

そのオブジェクトに対して定義されている特異メソッド名 (public あるいは protected メソッド) の一覧を返します。

...異メソッドとは Object#extend によって追加された特異メソッドや、
self がクラスの場合はスーパークラスのクラスメソッド(Classのインスタンスの特異メソッド)などです。

singleton_methods(false) は、Object#methods(false) と同じです。...
...c; def public_self() end
end

# あるオブジェクトの特異メソッドの一覧を得る。
p obj.singleton_methods(false)
p obj.methods(false)
p Foo.singleton_methods(false)

#実行結果

[:protected_self, :public_self]
[:protected_self, :public_self]
[:protected_class_foo, :public_c...
...p obj.singleton_methods(true)
p Foo.singleton_methods(true) - Object.singleton_methods(true)

#実行結果

[:protected_self, :public_self, :protected_bar, :public_bar]
[:protected_class_foo, :public_class_foo, :protected_class_parent, :public_class_parent]
//}

@see Object#methods,Object#extend...

JSON::Generator::GeneratorMethods::String::Extend.json_create(hash) -> String (9000.0)

JSON のオブジェクトから Ruby の文字列を生成して返します。

JSON のオブジェクトから Ruby の文字列を生成して返します。

@param hash キーとして "raw" という文字列を持ち、その値として数値の配列を持つハッシュを指定します。

require 'json'
String.json_create({"raw" => [0x41, 0x42, 0x43]}) # => "ABC"

IRB::ExtendCommand::Help#execute(*names) -> nil (3012.0)

RI から Ruby のドキュメントを参照します。

...ができます。また、空行を入力する事で irb のプロンプトに戻る事ができま
す。

irb(main):001:0> help

Enter the method name you want to look up.
You can use tab to autocomplete.
Enter a blank line to exit.

>> String#match
String#match

(from ruby core)...

Forwardable#def_delegator(accessor, method, ali = method) -> () (438.0)

メソッドの委譲先を設定します。

...

@param accessor 委譲先のオブジェクト

@param method 委譲先のメソッド

@param ali 委譲元のメソッド

委譲元のオブジェクトで ali が呼び出された場合に、
委譲先のオブジェクトの method へ処理が委譲されるようになります。

...
...require 'forwardable'
class MyQueue
extend
Forwardable
attr_reader :queue
def initialize
@queue = []
end

def_delegator :@queue, :push, :mypush
end

q = MyQueue.new
q.mypush 42
q.queue # => [42]
q.push 23 # => NoMethodError

@see Forwardable#def_delegators...
<< 1 2 > >>