Class: InstanceAccountant::Hour
- Inherits:
-
Object
- Object
- InstanceAccountant::Hour
- Defined in:
- lib/instance_accountant/hour.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
- #hour_string ⇒ Object
-
#initialize(options = { }) ⇒ Hour
constructor
A new instance of Hour.
- #to_s ⇒ Object
Constructor Details
#initialize(options = { }) ⇒ Hour
Returns a new instance of Hour.
6 7 8 |
# File 'lib/instance_accountant/hour.rb', line 6 def initialize = { } @time = [:time] ? [:time].utc : now() end |
Instance Method Details
#==(other) ⇒ Object
10 11 12 |
# File 'lib/instance_accountant/hour.rb', line 10 def == other hour_string == other.hour_string end |
#hour_string ⇒ Object
18 19 20 |
# File 'lib/instance_accountant/hour.rb', line 18 def hour_string to_s[0..12] + ':00:00Z' end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/instance_accountant/hour.rb', line 14 def to_s @time.iso8601 end |