Class: PartnerService::Inventories::ChartService
- Inherits:
-
ApplicationService
- Object
- ApplicationService
- PartnerService::Inventories::ChartService
- Defined in:
- app/services/partner_service/inventories/chart_service.rb
Instance Attribute Summary
Attributes inherited from ApplicationService
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(inventories, restaurant) ⇒ ChartService
constructor
A new instance of ChartService.
Methods inherited from ApplicationService
Constructor Details
#initialize(inventories, restaurant) ⇒ ChartService
Returns a new instance of ChartService.
6 7 8 9 10 |
# File 'app/services/partner_service/inventories/chart_service.rb', line 6 def initialize(inventories, restaurant) @time = Time.current @inventories = inventories @restaurant = restaurant end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'app/services/partner_service/inventories/chart_service.rb', line 12 def call this_month = chart_calculate(@time.beginning_of_month, @time.end_of_month) previous_month = chart_calculate(@time.prev_month, @time.prev_month.end_of_month) { this_month: this_month, previous_month: previous_month } end |