module Mongoid::Timespanned

Attributes

log[RW]

Public Class Methods

log!() click to toggle source
# File lib/timespan/mongoid/timespanned.rb, line 22
def log!
  @log = true
end
log?() click to toggle source
# File lib/timespan/mongoid/timespanned.rb, line 18
def log?
  @log
end

Public Instance Methods

asap_for(tspan_field = :period) click to toggle source
# File lib/timespan/mongoid/timespanned.rb, line 5
def asap_for tspan_field = :period
  ts = ::Timespan.asap duration: send(tspan_field).duration
  self.send("#{tspan_field}=", ts)
  self.save!
end