Class: Sapphire::DSL::Browser::Day
- Defined in:
- lib/sapphire/DSL/Browser/Nouns/Day.rb
Instance Method Summary collapse
- #Differ(comparator) ⇒ Object
- #Fix(evaluation, comparator) ⇒ Object
-
#initialize(value, compare1, compare2) ⇒ Day
constructor
A new instance of Day.
Constructor Details
#initialize(value, compare1, compare2) ⇒ Day
Returns a new instance of Day.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/sapphire/DSL/Browser/Nouns/Day.rb', line 13 def initialize(value, compare1, compare2) @value = value if(compare1.is_a?(String)) @compare1 = Date.parse(compare1) else @compare1 = compare1 end if(compare2.is_a?(String)) @compare2 = Date.parse(compare2) else @compare2 = compare2 end end |
Instance Method Details
#Differ(comparator) ⇒ Object
28 29 30 |
# File 'lib/sapphire/DSL/Browser/Nouns/Day.rb', line 28 def Differ(comparator) return Fix(DifferComparison.new(Evaluation.new(@compare1 + @value, @compare2)), comparator) end |
#Fix(evaluation, comparator) ⇒ Object
32 33 34 35 36 |
# File 'lib/sapphire/DSL/Browser/Nouns/Day.rb', line 32 def Fix(evaluation, comparator) comparator = comparator.Create(evaluation) comparator end |