Class: Getto::Roda::Time

Inherits:
Object
  • Object
show all
Defined in:
lib/getto/roda/time.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(now:, time_zone:) ⇒ Time

Returns a new instance of Time.



6
7
8
9
# File 'lib/getto/roda/time.rb', line 6

def initialize(now:, time_zone:)
  @time_zone = time_zone
  @now = now
end

Instance Attribute Details

#nowObject (readonly)

Returns the value of attribute now.



11
12
13
# File 'lib/getto/roda/time.rb', line 11

def now
  @now
end

Instance Method Details

#parse(str) ⇒ Object



13
14
15
# File 'lib/getto/roda/time.rb', line 13

def parse(str)
  @time_zone.local_to_utc ::Time.parse(str)
end