るりまサーチ

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

別のキーワード

  1. argf.class each
  2. argf.class each_line
  3. argf.class lines
  4. class new
  5. argf.class gets

ライブラリ

モジュール

検索結果

Kernel#DelegateClass(superclass) -> object (20318.0)

クラス superclass のインスタンスへメソッドを委譲するクラスを定義し、 そのクラスを返します。

...クラス superclass のインスタンスへメソッドを委譲するクラスを定義し、
そのクラスを返します。

@param superclass 委譲先となるクラス

例:

//emlist{
require 'delegate'

class
ExtArray < DelegateClass(Array)
def initialize
super([])
end
end
a = E...
...xtArray.new
p a.class # => ExtArray
a.push 25
p a # => [25]
//}...

Forwardable#delegate(hash) -> () (18120.0)

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

...。キーは 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...

Forwardable#instance_delegate(hash) -> () (6120.0)

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

...。キーは 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...

Ruby用語集 (102.0)

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

...

https://mruby.org/

: main
トップレベルにおける self。Object クラスのインスタンスである。

===[a:N] N

: nil
NilClass の唯一のインスタンス。また、そのオブジェクトを指す擬似変数の名前。
論理値としては偽である。

Ruby...
...ッシュに呼び出しを丸投げすることで実装が簡素化できる。

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

: イテレーター
: iterator
一般には繰り返し(反復)を抽象化する仕組み全般を指す...
...する。

オブジェクト空間に関する情報は ObjectSpace クラスで得ることが
できる。

: オープンクラス
: open class
組込みのクラスが再定義可能であること。
Ruby は String や Integer といった基本的なクラスも自由に改変でき...

ruby 1.8.3 feature (90.0)

ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))

...は、$SAFE レベル が 0 のとき
禁止されるようになりました。

$ cat mthd_taint.rb
th = Thread.new{
$SAFE = 3
class
Hoge
def foo
puts "safe level: #{$SAFE}"
end
end
}
th.join
p $SAFE
Hoge.new.foo

$ ruby...
...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> (NoMethodError)

$ ruby-1.8.3 -r delegate test_dlg.rb
bar

=== 2005-06-20
: DBM#closed? [lib] [new]
: GDBM#closed? [li...
...: Module#class_variable_get [ruby] [new]
: Module#class_variable_set [ruby] [new]

クラスメソッドから((<変数と定数/クラス変数>))にアクセスするための
((<Module#class_variable_get|Module/class_variable_get>)) と
((<Module#class_variable_set|Module/class_variable_...

絞り込み条件を変える

NEWS for Ruby 2.7.0 (42.0)

NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...ted です。 15575
この警告は「-W:no-deprecated」オプションで止められます。

//emlist{
def foo
class
<< Object.new
yield #=> warning: `yield' in class syntax will not be supported from Ruby 3.0. 15575
end
end
foo { p :ok }
//}

* 引数を転送する記法「(...)...
...sday?) #=> next Tuesday
//}
//emlist[Enumerator::Lazy#eager][ruby]{
a = %w(foo bar baz)
e = a.lazy.map {|x| x.upcase }.map {|x| x + "!" }.eager
p e.class #=> Enumerator
p e.map {|x| x + "?" } #=> ["FOO!?", "BAR!?", "BAZ!?"]
//}
//emlist[Enumerator::Lazy#with_index][ruby]{
("a"..).lazy...
...1, Date.parseが新しい日本の年号を
サポートしました。 15742

* Delegator
* Object#DelegateClassがブロックを受け付けるようになり、
Class
.newやStruct.newのように返り値のクラスのコンテキストで
module_evalするようにな...