Class: Flightdeck::BulkAction::Result
- Inherits:
-
Struct
- Object
- Struct
- Flightdeck::BulkAction::Result
- Defined in:
- app/models/flightdeck/bulk_action.rb
Instance Attribute Summary collapse
-
#failed ⇒ Object
Returns the value of attribute failed.
-
#processed ⇒ Object
Returns the value of attribute processed.
-
#stopped ⇒ Object
Returns the value of attribute stopped.
-
#total ⇒ Object
Returns the value of attribute total.
-
#total_capped ⇒ Object
Returns the value of attribute total_capped.
Instance Method Summary collapse
Instance Attribute Details
#failed ⇒ Object
Returns the value of attribute failed
19 20 21 |
# File 'app/models/flightdeck/bulk_action.rb', line 19 def failed @failed end |
#processed ⇒ Object
Returns the value of attribute processed
19 20 21 |
# File 'app/models/flightdeck/bulk_action.rb', line 19 def processed @processed end |
#stopped ⇒ Object
Returns the value of attribute stopped
19 20 21 |
# File 'app/models/flightdeck/bulk_action.rb', line 19 def stopped @stopped end |
#total ⇒ Object
Returns the value of attribute total
19 20 21 |
# File 'app/models/flightdeck/bulk_action.rb', line 19 def total @total end |
#total_capped ⇒ Object
Returns the value of attribute total_capped
19 20 21 |
# File 'app/models/flightdeck/bulk_action.rb', line 19 def total_capped @total_capped end |
Instance Method Details
#remaining ⇒ Object
21 |
# File 'app/models/flightdeck/bulk_action.rb', line 21 def remaining = [ total - processed, 0 ].max |
#remaining? ⇒ Boolean
22 |
# File 'app/models/flightdeck/bulk_action.rb', line 22 def remaining? = stopped_early? && remaining.positive? |
#stopped_early? ⇒ Boolean
20 |
# File 'app/models/flightdeck/bulk_action.rb', line 20 def stopped_early? = stopped.present? |
#total_label ⇒ Object
23 |
# File 'app/models/flightdeck/bulk_action.rb', line 23 def total_label = total_capped ? "#{total}+" : total.to_s |