Class: AnyValue::Composite
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- AnyValue::Composite
- Defined in:
- lib/any_value.rb
Instance Method Summary collapse
- #==(o) ⇒ Object
- #^(other) ⇒ Object
-
#initialize(left, right) ⇒ Composite
constructor
A new instance of Composite.
- #inspect ⇒ Object
Constructor Details
#initialize(left, right) ⇒ Composite
Returns a new instance of Composite.
48 49 50 51 |
# File 'lib/any_value.rb', line 48 def initialize(left, right) super(left) @right = right end |
Instance Method Details
#==(o) ⇒ Object
53 54 55 |
# File 'lib/any_value.rb', line 53 def ==(o) __getobj__.==(o) && @right.==(o) end |
#^(other) ⇒ Object
57 58 59 |
# File 'lib/any_value.rb', line 57 def ^(other) Composite.new(self, other) end |
#inspect ⇒ Object
61 62 63 |
# File 'lib/any_value.rb', line 61 def inspect "#<Composite #{__getobj__.inspect} #{@right.inspect}>" end |