Class: Vishnu::StandardTime::Plan::Block
- Inherits:
-
Struct
- Object
- Struct
- Vishnu::StandardTime::Plan::Block
- Defined in:
- lib/vishnu/standard_time.rb
Instance Attribute Summary collapse
-
#flows ⇒ Object
Returns the value of attribute flows.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#flows ⇒ Object
Returns the value of attribute flows
121 122 123 |
# File 'lib/vishnu/standard_time.rb', line 121 def flows @flows end |
#name ⇒ Object
Returns the value of attribute name
121 122 123 |
# File 'lib/vishnu/standard_time.rb', line 121 def name @name end |
Instance Method Details
#minutes ⇒ Object
122 123 124 |
# File 'lib/vishnu/standard_time.rb', line 122 def minutes Vishnu::StandardTime.minutes_for(flows: flows) end |
#percent_of_day ⇒ Object
126 127 128 |
# File 'lib/vishnu/standard_time.rb', line 126 def percent_of_day (flows.to_f / Vishnu::StandardTime::FLOWS_PER_DAY) * 100 end |
#to_h ⇒ Object
130 131 132 133 134 135 136 137 |
# File 'lib/vishnu/standard_time.rb', line 130 def to_h { name: name, flows: flows, minutes: minutes, percent_of_day: percent_of_day.round(4) } end |