48件ヒット
[1-48件を表示]
(0.113秒)
種類
- インスタンスメソッド (36)
- 文書 (12)
ライブラリ
- delegate (12)
- forwardable (24)
モジュール
- Forwardable (24)
- Kernel (12)
キーワード
- DelegateClass (12)
-
instance
_ delegate (12) -
ruby 1
. 8 . 3 feature (12)
検索結果
先頭4件
-
Forwardable
# delegate(hash) -> () (24220.0) -
メソッドの委譲先を設定します。
...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"... -
Kernel
# DelegateClass(superclass) -> object (20212.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 # => [25]
//}... -
Forwardable
# instance _ delegate(hash) -> () (12220.0) -
メソッドの委譲先を設定します。
...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"... -
ruby 1
. 8 . 3 feature (3054.0) -
ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))
...ruby 1.8.3 feature
*((<ruby 1.8 feature>))
*((<ruby 1.8.2 feature>))
ruby 1.8.2 から ruby 1.8.3 までの変更点です。
掲載方針
*バグ修正の影響も含めて動作が変わるものを収録する。
*単にバグを直しただけのものは収録しない。
*ライブラリ......uby-talk:146776>)) ((<ruby-talk:146894>))
$ cat test_dlg.rb
foo = Object.new
foo2 = SimpleDelegator.new(foo)
def foo.bar
puts "bar"
end
foo2.bar
$ ruby-1.8.2 -r delegate test_dlg.rb
test_dlg.rb:6: undefined method `bar' for #<Object:0x4021b0a0> (NoMethod......232>))
=== 2005-05-24
: getopts [lib] [obsolete]
getopts が deprecated になりました。deprecated であるという警告は、
オプションに -w を付けた時に出ます。((<ruby-dev:26201>))
=== 2005-05-22
: OpenSSL::SSL::SSLServer#initialize(svr, ctx, session_id=nil)
sessio...