Class: Moory::Pair

Inherits:
Struct
  • Object
show all
Defined in:
lib/moory/pair.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#leftObject

Returns the value of attribute left

Returns:

  • (Object)

    the current value of left



2
3
4
# File 'lib/moory/pair.rb', line 2

def left
  @left
end

#rightObject

Returns the value of attribute right

Returns:

  • (Object)

    the current value of right



2
3
4
# File 'lib/moory/pair.rb', line 2

def right
  @right
end

Instance Method Details

#shunt(value) ⇒ Object



7
8
9
# File 'lib/moory/pair.rb', line 7

def shunt(value)
  { left => { right => value } }
end

#valid?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/moory/pair.rb', line 3

def valid?
  left && right
end