Class: SlotsUsagePercentage
- Inherits:
-
Object
- Object
- SlotsUsagePercentage
- Defined in:
- app/services/slots_usage_percentage.rb
Instance Method Summary collapse
-
#initialize(slots) ⇒ SlotsUsagePercentage
constructor
A new instance of SlotsUsagePercentage.
- #perform ⇒ Object
Constructor Details
#initialize(slots) ⇒ SlotsUsagePercentage
Returns a new instance of SlotsUsagePercentage.
4 5 6 |
# File 'app/services/slots_usage_percentage.rb', line 4 def initialize(slots) @slots = slots end |
Instance Method Details
#perform ⇒ Object
8 9 10 11 |
# File 'app/services/slots_usage_percentage.rb', line 8 def perform (((@slots.size - available_slots.size).to_f / @slots.size) * 100) .round(2) end |