lib/rails_units/time.rb in rails-units-1.5.2 vs lib/rails_units/time.rb in rails-units-1.6.0
- old
+ new
@@ -9,15 +9,15 @@
alias unit_time_at at
end
# Convert a duration to a Time value by considering the duration to be the number of seconds since the
# epoch
- def self.at(arg)
+ def self.at(arg, ms = 0)
case arg
when Unit
unit_time_at(arg.to("s").scalar)
else
- unit_time_at(arg)
+ unit_time_at(arg, ms)
end
end
def to_unit(other = nil)
other ? Unit.new(self).to(other) : Unit.new(self)