Class: Predicated::Binary

Inherits:
Predicate show all
Includes:
Enumerable, FlipThroughMe, ValueEquality, PrintSupport
Defined in:
lib/predicated/print.rb,
lib/predicated/predicate.rb

Direct Known Subclasses

And, Operation, Or

Defined Under Namespace

Modules: FlipThroughMe, ValueEquality

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ValueEquality

#==

Methods included from FlipThroughMe

#each

Methods included from PrintSupport

#inspect

Methods inherited from Predicate

from_callable_object, from_json_str, from_json_struct, from_ruby_code_string, from_url_part, from_xml

Constructor Details

#initialize(left, right) ⇒ Binary

Returns a new instance of Binary.



45
46
47
48
# File 'lib/predicated/predicate.rb', line 45

def initialize(left, right)
  @left = left
  @right = right
end

Instance Attribute Details

#leftObject

Returns the value of attribute left.



43
44
45
# File 'lib/predicated/predicate.rb', line 43

def left
  @left
end

#rightObject

Returns the value of attribute right.



43
44
45
# File 'lib/predicated/predicate.rb', line 43

def right
  @right
end

Instance Method Details

#to_sObject



40
41
42
# File 'lib/predicated/print.rb', line 40

def to_s
  "#{self.class.shorthand}(#{part_to_s(left)},#{part_to_s(right)})"
end