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

Instance Method Details

#as_of_timeObject

Reads the virtual ‘as_of_time’ attribute



18
19
20
# File 'lib/chrono_model/patches/as_of_time_holder.rb', line 18

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.



10
11
12
13
14
# File 'lib/chrono_model/patches/as_of_time_holder.rb', line 10

def as_of_time!(time)
  @_as_of_time = time.utc

  self
end