Class: AnyValue::Composite

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/any_value.rb

Instance Method Summary collapse

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

#inspectObject



61
62
63
# File 'lib/any_value.rb', line 61

def inspect
  "#<Composite #{__getobj__.inspect} #{@right.inspect}>"
end