Class: Flightdeck::BulkAction::Result

Inherits:
Struct
  • Object
show all
Defined in:
app/models/flightdeck/bulk_action.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#failedObject

Returns the value of attribute failed

Returns:

  • (Object)

    the current value of failed



19
20
21
# File 'app/models/flightdeck/bulk_action.rb', line 19

def failed
  @failed
end

#processedObject

Returns the value of attribute processed

Returns:

  • (Object)

    the current value of processed



19
20
21
# File 'app/models/flightdeck/bulk_action.rb', line 19

def processed
  @processed
end

#stoppedObject

Returns the value of attribute stopped

Returns:

  • (Object)

    the current value of stopped



19
20
21
# File 'app/models/flightdeck/bulk_action.rb', line 19

def stopped
  @stopped
end

#totalObject

Returns the value of attribute total

Returns:

  • (Object)

    the current value of total



19
20
21
# File 'app/models/flightdeck/bulk_action.rb', line 19

def total
  @total
end

#total_cappedObject

Returns the value of attribute total_capped

Returns:

  • (Object)

    the current value of total_capped



19
20
21
# File 'app/models/flightdeck/bulk_action.rb', line 19

def total_capped
  @total_capped
end

Instance Method Details

#remainingObject



21
# File 'app/models/flightdeck/bulk_action.rb', line 21

def remaining = [ total - processed, 0 ].max

#remaining?Boolean

Returns:

  • (Boolean)


22
# File 'app/models/flightdeck/bulk_action.rb', line 22

def remaining? = stopped_early? && remaining.positive?

#stopped_early?Boolean

Returns:

  • (Boolean)


20
# File 'app/models/flightdeck/bulk_action.rb', line 20

def stopped_early? = stopped.present?

#total_labelObject



23
# File 'app/models/flightdeck/bulk_action.rb', line 23

def total_label = total_capped ? "#{total}+" : total.to_s