Class: RestaurantPackageTypesCached
- Inherits:
-
Object
- Object
- RestaurantPackageTypesCached
- Defined in:
- app/my_lib/restaurant_package_types_cached.rb
Overview
Fetch available package types based on restaurant
Instance Attribute Summary collapse
-
#restaurant_id ⇒ Object
Returns the value of attribute restaurant_id.
Instance Method Summary collapse
-
#initialize(restaurant_id) ⇒ RestaurantPackageTypesCached
constructor
A new instance of RestaurantPackageTypesCached.
- #restaurant ⇒ Object
Constructor Details
#initialize(restaurant_id) ⇒ RestaurantPackageTypesCached
Returns a new instance of RestaurantPackageTypesCached.
8 9 10 11 |
# File 'app/my_lib/restaurant_package_types_cached.rb', line 8 def initialize(restaurant_id) self.restaurant_id = restaurant_id @restaurant = {} end |
Instance Attribute Details
#restaurant_id ⇒ Object
Returns the value of attribute restaurant_id.
7 8 9 |
# File 'app/my_lib/restaurant_package_types_cached.rb', line 7 def restaurant_id @restaurant_id end |
Instance Method Details
#restaurant ⇒ Object
21 22 23 |
# File 'app/my_lib/restaurant_package_types_cached.rb', line 21 def restaurant @restaurant[restaurant_id] ||= Restaurant.fetch(restaurant_id) end |