Class: TwitterCldr::Shared::DayPeriods::Timestamp
- Inherits:
-
Object
- Object
- TwitterCldr::Shared::DayPeriods::Timestamp
- Includes:
- Comparable
- Defined in:
- lib/twitter_cldr/shared/day_periods.rb
Instance Attribute Summary collapse
-
#hour ⇒ Object
readonly
Returns the value of attribute hour.
-
#min ⇒ Object
readonly
Returns the value of attribute min.
-
#sec ⇒ Object
readonly
Returns the value of attribute sec.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(hour, min, sec) ⇒ Timestamp
constructor
A new instance of Timestamp.
- #to_f ⇒ Object
Constructor Details
#initialize(hour, min, sec) ⇒ Timestamp
Returns a new instance of Timestamp.
17 18 19 20 21 |
# File 'lib/twitter_cldr/shared/day_periods.rb', line 17 def initialize(hour, min, sec) @hour = hour @min = min @sec = sec end |
Instance Attribute Details
#hour ⇒ Object (readonly)
Returns the value of attribute hour.
15 16 17 |
# File 'lib/twitter_cldr/shared/day_periods.rb', line 15 def hour @hour end |
#min ⇒ Object (readonly)
Returns the value of attribute min.
15 16 17 |
# File 'lib/twitter_cldr/shared/day_periods.rb', line 15 def min @min end |
#sec ⇒ Object (readonly)
Returns the value of attribute sec.
15 16 17 |
# File 'lib/twitter_cldr/shared/day_periods.rb', line 15 def sec @sec end |
Instance Method Details
#<=>(other) ⇒ Object
27 28 29 |
# File 'lib/twitter_cldr/shared/day_periods.rb', line 27 def <=>(other) to_f <=> other.to_f end |
#to_f ⇒ Object
23 24 25 |
# File 'lib/twitter_cldr/shared/day_periods.rb', line 23 def to_f @to_f ||= hour * 60 * 60 + min * 60.0 + sec end |