Class: Vishnu::StandardTime::Duration
- Inherits:
-
Struct
- Object
- Struct
- Vishnu::StandardTime::Duration
- Defined in:
- lib/vishnu/standard_time.rb
Instance Attribute Summary collapse
-
#flows ⇒ Object
Returns the value of attribute flows.
-
#milliseconds ⇒ Object
Returns the value of attribute milliseconds.
-
#seconds ⇒ Object
Returns the value of attribute seconds.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
Instance Attribute Details
#flows ⇒ Object
Returns the value of attribute flows
40 41 42 |
# File 'lib/vishnu/standard_time.rb', line 40 def flows @flows end |
#milliseconds ⇒ Object
Returns the value of attribute milliseconds
40 41 42 |
# File 'lib/vishnu/standard_time.rb', line 40 def milliseconds @milliseconds end |
#seconds ⇒ Object
Returns the value of attribute seconds
40 41 42 |
# File 'lib/vishnu/standard_time.rb', line 40 def seconds @seconds end |
#target ⇒ Object
Returns the value of attribute target
40 41 42 |
# File 'lib/vishnu/standard_time.rb', line 40 def target @target end |
Instance Method Details
#hours ⇒ Object
51 52 53 |
# File 'lib/vishnu/standard_time.rb', line 51 def hours seconds / 3600.0 end |
#minutes ⇒ Object
47 48 49 |
# File 'lib/vishnu/standard_time.rb', line 47 def minutes seconds / 60.0 end |
#to_h ⇒ Object
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/vishnu/standard_time.rb', line 55 def to_h { flows: flows, milliseconds: milliseconds, seconds: seconds, minutes: minutes, hours: hours, target: target && Vishnu::StandardTime.to_h(target) } end |