Module: ChronoModel::Patches::AsOfTimeHolder

Included in:
Relation, TimeGate, TimeMachine
Defined in:
lib/chrono_model/patches.rb

Instance Method Summary collapse

Instance Method Details

#as_of_timeObject

Reads the virtual 'as_of_time' attribute

See ChronoModel::Patches::AsOfTimeHolder


21
22
23
# File 'lib/chrono_model/patches.rb', line 21

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.

See ChronoModel::Patches::AsOfTimeHolder


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

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

  self
end