Class: Restaurants::PictureDecorator
- Inherits:
-
Object
- Object
- Restaurants::PictureDecorator
- Defined in:
- app/decorators/restaurants/picture_decorator.rb
Overview
Decorate Restaurants::Picture instance
Instance Attribute Summary collapse
-
#picture ⇒ Object
Returns the value of attribute picture.
Instance Method Summary collapse
- #decorated_caption ⇒ Object
-
#initialize(picture) ⇒ PictureDecorator
constructor
A new instance of PictureDecorator.
Constructor Details
#initialize(picture) ⇒ PictureDecorator
Returns a new instance of PictureDecorator.
10 11 12 13 |
# File 'app/decorators/restaurants/picture_decorator.rb', line 10 def initialize(picture) self.picture = picture @package_list = {} end |
Instance Attribute Details
#picture ⇒ Object
Returns the value of attribute picture.
6 7 8 |
# File 'app/decorators/restaurants/picture_decorator.rb', line 6 def picture @picture end |
Instance Method Details
#decorated_caption ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'app/decorators/restaurants/picture_decorator.rb', line 15 def decorated_caption suffix = if package_list.include_ayce? || package_list.include_bfp? I18n.t('seo.restaurants.photos.caption_ayce_like', name: package_list.restaurant&.name) else # Party Pack I18n.t('seo.restaurants.photos.caption_pp_like', name: package_list.restaurant&.name) end [picture&.caption, suffix].compact.join(' - ') end |