Class: Halftime::TimeFactory
- Inherits:
-
Object
- Object
- Halftime::TimeFactory
- Defined in:
- lib/halftime/time_factory.rb
Instance Method Summary collapse
-
#initialize(date_factory: DateFactories::Today.new, time_of_day: TimeOfDay.new, time_zone: TimeZones::Current) ⇒ TimeFactory
constructor
A new instance of TimeFactory.
- #time(now) ⇒ Object
Constructor Details
#initialize(date_factory: DateFactories::Today.new, time_of_day: TimeOfDay.new, time_zone: TimeZones::Current) ⇒ TimeFactory
Returns a new instance of TimeFactory.
9 10 11 12 13 14 15 16 17 |
# File 'lib/halftime/time_factory.rb', line 9 def initialize( date_factory: DateFactories::Today.new, time_of_day: TimeOfDay.new, time_zone: TimeZones::Current ) @date_factory = date_factory @time_of_day = time_of_day @time_zone = time_zone end |
Instance Method Details
#time(now) ⇒ Object
19 20 21 |
# File 'lib/halftime/time_factory.rb', line 19 def time(now) advance(base_time(now), now) end |