Class: Halftime::TimeOfDay
- Inherits:
-
Object
- Object
- Halftime::TimeOfDay
- Defined in:
- lib/halftime/time_of_day.rb
Instance Attribute Summary collapse
-
#minute ⇒ Object
readonly
Returns the value of attribute minute.
-
#second ⇒ Object
readonly
Returns the value of attribute second.
Instance Method Summary collapse
- #ambiguous? ⇒ Boolean
-
#initialize(hour: 12, minute: 0, second: 0, meridiem_factory: Meridies::Unspecified) ⇒ TimeOfDay
constructor
A new instance of TimeOfDay.
Constructor Details
#initialize(hour: 12, minute: 0, second: 0, meridiem_factory: Meridies::Unspecified) ⇒ TimeOfDay
Returns a new instance of TimeOfDay.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/halftime/time_of_day.rb', line 9 def initialize( hour: 12, minute: 0, second: 0, meridiem_factory: Meridies::Unspecified ) @minute = minute @second = second @meridiem = meridiem_factory.new(hour) end |
Instance Attribute Details
#minute ⇒ Object (readonly)
Returns the value of attribute minute.
5 6 7 |
# File 'lib/halftime/time_of_day.rb', line 5 def minute @minute end |
#second ⇒ Object (readonly)
Returns the value of attribute second.
5 6 7 |
# File 'lib/halftime/time_of_day.rb', line 5 def second @second end |
Instance Method Details
#ambiguous? ⇒ Boolean
20 21 22 |
# File 'lib/halftime/time_of_day.rb', line 20 def ambiguous? meridiem.unspecified? end |