Module: ChronoModel::Patches::AsOfTimeHolder
- Included in:
- Relation, TimeGate, TimeMachine
- Defined in:
- lib/chrono_model/patches/as_of_time_holder.rb
Overview
Added to classes that need to carry the As-Of date around
Instance Method Summary collapse
-
#as_of_time ⇒ Object
Reads the virtual ‘as_of_time’ attribute.
-
#as_of_time!(time) ⇒ Object
Sets the virtual ‘as_of_time’ attribute to the given time, converting to UTC.
Instance Method Details
#as_of_time ⇒ Object
Reads the virtual ‘as_of_time’ attribute
17 18 19 |
# File 'lib/chrono_model/patches/as_of_time_holder.rb', line 17 def as_of_time @_as_of_time end |
#as_of_time!(time) ⇒ Object
Sets the virtual ‘as_of_time’ attribute to the given time, converting to UTC.
9 10 11 12 13 |
# File 'lib/chrono_model/patches/as_of_time_holder.rb', line 9 def as_of_time!(time) @_as_of_time = time.utc self end |