るりまサーチ

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

別のキーワード

  1. cgi out
  2. zlib total_out
  3. cgi/core out
  4. zstream avail_out
  5. zlib avail_out

種類

ライブラリ

キーワード

検索結果

Forwardable (38018.0)

クラスに対し、メソッドの委譲機能を定義するモジュールです。

...ject#extend して使います。Module#include でないところに注意して下さい。

例:

require 'forwardable'
class Foo
extend Forwardable

def_delegators("@out", "printf", "print")
def_delegators(:@in, :gets)
def_delegator(:@contents, :[], "content_at")
end...

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 1.6 feature (18.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...を返していた
p "foo".slice!(5,10)

=> ruby 1.6.7 (2002-03-01) [i586-linux]
nil
-:2:in `slice!': index 5 out of string (IndexError)
from -:2
=> ruby 1.6.7 (2002-08-01) [i586-linux]
nil
nil

: 2002-07-05 String#...
...たリゾルバは、timeout の制御が効きます(つまり、名前解
決中にThreadが切替え可能ということです)

require 'resolv'
p Resolv.new.getaddress("www.ruby-lang.org").to_s

=> /usr/local/lib/ruby/1.6/resolv.rb:160: warning: timeout (...) interpreted as metho...
...準ライブラリとして新規に追加されました。
(ドキュメントが doc ディレクトリにあります)

: ((<forwardable>))

forwardable
1.1 が標準ライブラリとして新規に追加されました。
(ドキュメントが doc ディレクトリにあります...

Ruby用語集 (12.0)

Ruby用語集 A B C D E F G I J M N O R S Y

...び出しを丸投げすることで実装が簡素化できる。

標準添付ライブラリーには、委譲を支援する delegate や
forwardable
がある。

: イテレーター
: iterator
一般には繰り返し(反復)を抽象化する仕組み全般を指す広い概念で...
...った
見た目に関すること、変数・メソッドなどの命名方針、ファイルパスなど。

: コメントアウト
: comment out
コメント化。プログラムの一部分を(コメント化記号の挿入により)コメントにすること。
不要になった処...