108件ヒット
[1-100件を表示]
(0.065秒)
別のキーワード
ライブラリ
- delegate (12)
-
fiddle
/ import (12) - forwardable (48)
- json (12)
-
rdoc
/ generator / darkfish (12) -
rdoc
/ generator / ri (12)
クラス
-
RDoc
:: Generator :: Darkfish (12) -
RDoc
:: Generator :: RI (12)
モジュール
-
Fiddle
:: Importer (12) - Forwardable (48)
-
JSON
:: Generator :: GeneratorMethods :: Object (12) - Kernel (12)
キーワード
- DelegateClass (12)
-
def
_ delegator (12) -
def
_ instance _ delegator (12) - delegate (12)
-
instance
_ delegate (12) - struct (12)
-
to
_ json (12)
検索結果
先頭5件
- RDoc
:: Generator :: Darkfish # initialize(store , options) -> RDoc :: Generator :: Darkfish - RDoc
:: Generator :: RI # initialize(store , options) -> RDoc :: Generator :: RI - Forwardable
# def _ delegator(accessor , method , ali = method) -> () - Forwardable
# def _ instance _ delegator(accessor , method , ali = method) -> () - Forwardable
# delegate(hash) -> ()
-
RDoc
:: Generator :: Darkfish # initialize(store , options) -> RDoc :: Generator :: Darkfish (21214.0) -
RDoc::Generator::Darkfish オブジェクトを初期化します。
...RDoc::Generator::Darkfish オブジェクトを初期化します。
@param store RDoc::Store オブジェクトを指定します。
@param options RDoc::Options オブジェクトを指定します。... -
RDoc
:: Generator :: RI # initialize(store , options) -> RDoc :: Generator :: RI (21214.0) -
RDoc::Generator::RI オブジェクトを初期化します。
...RDoc::Generator::RI オブジェクトを初期化します。
@param store RDoc::Store オブジェクトを指定します。
@param options RDoc::Options オブジェクトを指定します。... -
Forwardable
# def _ delegator(accessor , method , ali = method) -> () (6125.0) -
メソッドの委譲先を設定します。
...メソッドの委譲先を設定します。
@param accessor 委譲先のオブジェクト
@param method 委譲先のメソッド
@param ali 委譲元のメソッド
委譲元のオブジェクトで ali が呼び出された場合に、
委譲先のオブジェクトの method へ処理が......することが可能です。
def_delegator は def_instance_delegator の別名になります。
例:
require 'forwardable'
class MyQueue
extend Forwardable
attr_reader :queue
def initialize
@queue = []
end
def_delegator :@queue, :push, :mypush
end
q = MyQue......ue.new
q.mypush 42
q.queue # => [42]
q.push 23 # => NoMethodError
@see Forwardable#def_delegators... -
Forwardable
# def _ instance _ delegator(accessor , method , ali = method) -> () (6125.0) -
メソッドの委譲先を設定します。
...メソッドの委譲先を設定します。
@param accessor 委譲先のオブジェクト
@param method 委譲先のメソッド
@param ali 委譲元のメソッド
委譲元のオブジェクトで ali が呼び出された場合に、
委譲先のオブジェクトの method へ処理が......することが可能です。
def_delegator は def_instance_delegator の別名になります。
例:
require 'forwardable'
class MyQueue
extend Forwardable
attr_reader :queue
def initialize
@queue = []
end
def_delegator :@queue, :push, :mypush
end
q = MyQue......ue.new
q.mypush 42
q.queue # => [42]
q.push 23 # => NoMethodError
@see Forwardable#def_delegators... -
Forwardable
# delegate(hash) -> () (6113.0) -
メソッドの委譲先を設定します。
...す。
@param hash 委譲先のメソッドがキー、委譲先のオブジェクトが値の
Hash を指定します。キーは Symbol、
String かその配列で指定します。
例:
require 'forwardable'
class Zap
extend Forwardable
delegate :length......=> :@str
delegate [:first, :last] => :@arr
def initialize
@arr = %w/foo bar baz/
@str = "world"
end
end
zap = Zap.new
zap.length # => 5
zap.first # => "foo"
zap.last # => "baz"... -
Forwardable
# instance _ delegate(hash) -> () (6113.0) -
メソッドの委譲先を設定します。
...す。
@param hash 委譲先のメソッドがキー、委譲先のオブジェクトが値の
Hash を指定します。キーは Symbol、
String かその配列で指定します。
例:
require 'forwardable'
class Zap
extend Forwardable
delegate :length......=> :@str
delegate [:first, :last] => :@arr
def initialize
@arr = %w/foo bar baz/
@str = "world"
end
end
zap = Zap.new
zap.length # => 5
zap.first # => "foo"
zap.last # => "baz"... -
JSON
:: Generator :: GeneratorMethods :: Object # to _ json(state _ or _ hash = nil) -> String (6113.0) -
自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。
...フォールバックのためのメソッドです。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を......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
//}... -
Kernel
# DelegateClass(superclass) -> object (6113.0) -
クラス superclass のインスタンスへメソッドを委譲するクラスを定義し、 そのクラスを返します。
...ッドを委譲するクラスを定義し、
そのクラスを返します。
@param superclass 委譲先となるクラス
例:
//emlist{
require 'delegate'
class ExtArray < DelegateClass(Array)
def initialize
super([])
end
end
a = ExtArray.new
p a.class # => ExtArray
a.push 25
p a... -
Fiddle
:: Importer # struct(signature) -> Class (113.0) -
C の構造体型に対応する Ruby のクラスを構築して返します。
...る Ruby のクラスを構築して返します。
構造体の各要素は C と似せた表記ができます。そしてそれを
配列で signature に渡してデータを定義します。例えば C における
struct timeval {
long tv_sec;
long tv_usec;
};
という構造体......ます
* クラスメソッド malloc
* initialize
* to_ptr
* to_i
* 構造体の各メンバへのアクセサ
返されるクラスは Fiddle::CStruct を継承しています。詳しくは
そちらを参照してください。
@param signature 構造体の各要素を文字列で...