Class: PartnerService::Ranking::CalculateService
- Inherits:
-
ApplicationService
- Object
- ApplicationService
- PartnerService::Ranking::CalculateService
- Defined in:
- app/services/partner_service/ranking/calculate_service.rb
Instance Attribute Summary collapse
-
#cuisine ⇒ Object
Returns the value of attribute cuisine.
-
#location ⇒ Object
Returns the value of attribute location.
-
#package ⇒ Object
Returns the value of attribute package.
-
#restaurants_cuisine ⇒ Object
Returns the value of attribute restaurants_cuisine.
-
#restaurants_location ⇒ Object
Returns the value of attribute restaurants_location.
Attributes inherited from ApplicationService
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(restaurant) ⇒ CalculateService
constructor
A new instance of CalculateService.
Methods inherited from ApplicationService
Constructor Details
#initialize(restaurant) ⇒ CalculateService
Returns a new instance of CalculateService.
7 8 9 10 11 |
# File 'app/services/partner_service/ranking/calculate_service.rb', line 7 def initialize(restaurant) @today = Time.current.to_date @yesterday = @today - 1.days @restaurant = restaurant end |
Instance Attribute Details
#cuisine ⇒ Object
Returns the value of attribute cuisine.
5 6 7 |
# File 'app/services/partner_service/ranking/calculate_service.rb', line 5 def cuisine @cuisine end |
#location ⇒ Object
Returns the value of attribute location.
5 6 7 |
# File 'app/services/partner_service/ranking/calculate_service.rb', line 5 def location @location end |
#package ⇒ Object
Returns the value of attribute package.
5 6 7 |
# File 'app/services/partner_service/ranking/calculate_service.rb', line 5 def package @package end |
#restaurants_cuisine ⇒ Object
Returns the value of attribute restaurants_cuisine.
5 6 7 |
# File 'app/services/partner_service/ranking/calculate_service.rb', line 5 def restaurants_cuisine @restaurants_cuisine end |
#restaurants_location ⇒ Object
Returns the value of attribute restaurants_location.
5 6 7 |
# File 'app/services/partner_service/ranking/calculate_service.rb', line 5 def restaurants_location @restaurants_location end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'app/services/partner_service/ranking/calculate_service.rb', line 13 def call restaurant_tag_location = restaurant_tag(type: :location) restaurant_tag_cuisine = restaurant_tag(type: :cuisine) @restaurants_location = calculate('location', restaurant_tag_location) @restaurants_cuisine = calculate('cuisine', restaurant_tag_cuisine) @package = calculate_packages return self end |