94件ヒット
[1-94件を表示]
(0.057秒)
種類
- インスタンスメソッド (44)
- 文書 (28)
- モジュール (22)
ライブラリ
- forwardable (66)
モジュール
- Forwardable (44)
キーワード
-
NEWS for Ruby 2
. 6 . 0 (6) - Ruby用語集 (11)
- SingleForwardable (11)
-
def
_ delegator (11) -
def
_ instance _ delegator (11) - delegate (11)
-
instance
_ delegate (11) -
ruby 1
. 6 feature (11)
検索結果
先頭5件
-
Forwardable (38018.0)
-
クラスに対し、メソッドの委譲機能を定義するモジュールです。
...いところに注意して下さい。
例:
require 'forwardable'
class Foo
extend Forwardable
def_delegators("@out", "printf", "print")
def_delegators(:@in, :gets)
def_delegator(:@contents, :[], "content_at")
end
f = Foo.new
f.printf ...
f.gets
f.content_at(1)... -
NEWS for Ruby 2
. 6 . 0 (26090.0) -
NEWS for Ruby 2.6.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...NEWS for Ruby 2.6.0
このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス......作成するディスクリプタに FD_CLOEXEC フラグは設定されます。) 14907
* KeyError
* 新規オプション
* KeyError.new に :receiver と :key にオプションが追加されて
Ruby コードからも設定できるようになりました。 14313
* Met......(機能追加とバグ修正を除く)
* 以下の標準添付ライブラリがデフォルト gem になりました。
* e2mmap
* forwardable
* irb
* logger
* matrix
* mutex_m
* ostruct
* prime
* rexml
* rss
* shell
* sync
* thwait
* tra... -
ruby 1
. 6 feature (23282.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...00019>))
: 2002-09-11: Queue#((<Queue/pop>))
Queue#pop に競合状態の問題がありました ((<ruby-dev:17223>))
: 2002-09-11: SizedQueue.new
引数に 0 以下を受けつけるバグが修正されました。
: 2002-09-05: ((<リテラル/式展開>))
stable snapshot で、一......フォルト値 (((<Hash/default>))) も == で等しい
ときに等しいとみなされるようになりました。
p Hash.new("foo") == Hash.new("bar")
=> ruby 1.6.7 (2002-03-01) [i586-linux]
true
=> ruby 1.6.7 (2002-08-21) [i586-linux]
false......準ライブラリとして新規に追加されました。
(ドキュメントが doc ディレクトリにあります)
: ((<forwardable>))
forwardable 1.1 が標準ライブラリとして新規に追加されました。
(ドキュメントが doc ディレクトリにあります... -
Forwardable
# def _ delegator(accessor , method , ali = method) -> () (21024.0) -
メソッドの委譲先を設定します。
...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_delegato... -
Forwardable
# def _ instance _ delegator(accessor , method , ali = method) -> () (21024.0) -
メソッドの委譲先を設定します。
...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_delegato... -
Forwardable
# delegate(hash) -> () (21018.0) -
メソッドの委譲先を設定します。
...指定します。
例:
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 # =>... -
Forwardable
# instance _ delegate(hash) -> () (21018.0) -
メソッドの委譲先を設定します。
...指定します。
例:
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 # =>... -
SingleForwardable (6024.0)
-
オブジェクトに対し、メソッドの委譲機能を定義するモジュールです。
...ます。
例:
require 'forwardable'
g = Goo.new
g.extend SingleForwardable
g.def_delegator("@out", :puts)
g.puts ...
また、SingleForwardable はクラスやモジュールに対して以下のようにする事もできます。
require 'forwardable'
class Implementation
de.......service
puts "serviced!"
end
end
module Facade
extend SingleForwardable
def_delegator :Implementation, :service
end
Facade.service # => serviced!
もし Forwardable と SingleForwardable の両方を使いたい場合、
def_instance_delegator と def_single_delegator... -
Ruby用語集 (12.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...び出しを丸投げすることで実装が簡素化できる。
標準添付ライブラリーには、委譲を支援する delegate や
forwardable がある。
: イテレーター
: iterator
一般には繰り返し(反復)を抽象化する仕組み全般を指す広い概念で......文字としては特別扱いされない。
ただしパス名には使えず、ヌル文字を含んだ文字列を File.open や
Pathname.new に与えると ArgumentError が発生する。
他の言語では文字列の終端を意味することがあるので、文字列データ...