Class: Getto::Roda::Time
- Inherits:
-
Object
- Object
- Getto::Roda::Time
- Defined in:
- lib/getto/roda/time.rb
Instance Attribute Summary collapse
-
#now ⇒ Object
readonly
Returns the value of attribute now.
Instance Method Summary collapse
-
#initialize(now:, time_zone:) ⇒ Time
constructor
A new instance of Time.
- #parse(str) ⇒ Object
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
#now ⇒ Object (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 |