Class: Sapphire::DSL::Comparison

Inherits:
Object
  • Object
show all
Defined in:
lib/sapphire/DSL/Comparisons/Comparison.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(item) ⇒ Comparison

Returns a new instance of Comparison.



7
8
9
10
# File 'lib/sapphire/DSL/Comparisons/Comparison.rb', line 7

def initialize(item)
  @item = item
  @item.CompareWith(self) if @item.is_a? Evaluation or @item.is_a? Evaluator or @item.is_a? Comparison
end

Instance Attribute Details

#itemObject (readonly)

Returns the value of attribute item.



5
6
7
# File 'lib/sapphire/DSL/Comparisons/Comparison.rb', line 5

def item
  @item
end

Instance Method Details

#CompareWith(item) ⇒ Object



12
13
14
# File 'lib/sapphire/DSL/Comparisons/Comparison.rb', line 12

def CompareWith(item)
  @comparator = item
end

#Create(item) ⇒ Object



16
17
18
19
# File 'lib/sapphire/DSL/Comparisons/Comparison.rb', line 16

def Create(item)
  return self.class.new(item) if item.is_a? Comparison or item.is_a? Evaluation
  item
end

#EvaluateObject



25
26
27
# File 'lib/sapphire/DSL/Comparisons/Comparison.rb', line 25

def Evaluate()
  @item.Evaluate
end

#executeObject



45
46
47
# File 'lib/sapphire/DSL/Comparisons/Comparison.rb', line 45

def execute
  @item.execute
end

#leftObject



37
38
39
# File 'lib/sapphire/DSL/Comparisons/Comparison.rb', line 37

def left
  @item.left
end

#left=(val) ⇒ Object



29
30
31
# File 'lib/sapphire/DSL/Comparisons/Comparison.rb', line 29

def left=(val)
  @item.left=val
end

#OutputObject



21
22
23
# File 'lib/sapphire/DSL/Comparisons/Comparison.rb', line 21

def Output()
  @item.Output
end

#rightObject



41
42
43
# File 'lib/sapphire/DSL/Comparisons/Comparison.rb', line 41

def right
  @item.right
end

#right=(val) ⇒ Object



33
34
35
# File 'lib/sapphire/DSL/Comparisons/Comparison.rb', line 33

def right=(val)
  @item.right=val
end