るりまサーチ

最速Rubyリファレンスマニュアル検索!
38件ヒット [1-38件を表示] (0.017秒)

別のキーワード

  1. forwardable def_delegator
  2. forwardable def_instance_delegator
  3. delegate delegator
  4. delegator !
  5. delegator !=

ライブラリ

クラス

キーワード

検索結果

Delegator#! -> bool (39101.0)

自身を否定します。

自身を否定します。

Delegator#!=(obj) -> bool (27100.0)

自身が与えられたオブジェクトと等しくない場合は、真を返します。 そうでない場合は、偽を返します。

自身が与えられたオブジェクトと等しくない場合は、真を返します。
そうでない場合は、偽を返します。

@param obj 比較対象のオブジェクトを指定します。

SingleForwardable (30.0)

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

...d SingleForwardable
g.def_delegator("@out", :puts)
g.puts ...

また、SingleForwardable はクラスやモジュールに対して以下のようにする事もできます。

require 'forwardable'
class Implementation
def self.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 メソッドの方を呼び出して
ください。...

NEWS for Ruby 2.7.0 (18.0)

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

...を止める例:

//emlist{
$ ruby -e '0 in a'
-e:1: warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!

$ ruby -W:no-experimental -e '0 in a'
//}

* RUBYOPTで両方止めるにはスペース区切りで指定します:

//emlist{
$ RUBYOPT='-W:no-...
...st[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.with_index(1) { |it, index| puts...
...aster/NEWS.md

* Date
* Date.jisx0301, Date#jisx0301, Date.parseが新しい日本の年号を
サポートしました。 15742

* Delegator
* Object#DelegateClassがブロックを受け付けるようになり、
Class.newやStruct.newのように返り値のクラスの...