Class: HaveAPI::Client::ActionState::Progress
- Inherits:
-
Struct
- Object
- Struct
- HaveAPI::Client::ActionState::Progress
- Defined in:
- lib/haveapi/client/action_state.rb
Instance Attribute Summary collapse
-
#current ⇒ Object
Returns the value of attribute current.
-
#total ⇒ Object
Returns the value of attribute total.
-
#unit ⇒ Object
Returns the value of attribute unit.
Instance Method Summary collapse
Instance Attribute Details
#current ⇒ Object
Returns the value of attribute current
4 5 6 |
# File 'lib/haveapi/client/action_state.rb', line 4 def current @current end |
#total ⇒ Object
Returns the value of attribute total
4 5 6 |
# File 'lib/haveapi/client/action_state.rb', line 4 def total @total end |
#unit ⇒ Object
Returns the value of attribute unit
4 5 6 |
# File 'lib/haveapi/client/action_state.rb', line 4 def unit @unit end |
Instance Method Details
#percent ⇒ Object
5 6 7 |
# File 'lib/haveapi/client/action_state.rb', line 5 def percent 100.0 / total * current end |
#to_s ⇒ Object
9 10 11 |
# File 'lib/haveapi/client/action_state.rb', line 9 def to_s "#{current}/#{total} #{unit}" end |