Class: C2eCore::Drops::RecipeDrop
- Defined in:
- /build/app/mailers/c2e_core/drops/recipe_drop.rb
Instance Method Summary collapse
-
#code ⇒ String
-
Current code of recipe.
-
-
#initialize(recipe) ⇒ RecipeDrop
constructor
A new instance of RecipeDrop.
-
#name ⇒ String
-
Current name of recipe.
-
Constructor Details
#initialize(recipe) ⇒ RecipeDrop
Returns a new instance of RecipeDrop.
6 7 8 9 |
# File '/build/app/mailers/c2e_core/drops/recipe_drop.rb', line 6 def initialize(recipe) super() @recipe = recipe end |
Instance Method Details
#code ⇒ String
Returns - Current code of recipe. E.g.: “m42”.
19 20 21 |
# File '/build/app/mailers/c2e_core/drops/recipe_drop.rb', line 19 def code @recipe.code end |
#name ⇒ String
Returns - Current name of recipe. E.g.: “200g Zbojnický steak”.
12 13 14 15 16 |
# File '/build/app/mailers/c2e_core/drops/recipe_drop.rb', line 12 def name fall_back_language = Language.where(code: @recipe.company_branch.default_language).first @recipe.label.translation_with_fallback(::Language.default_locale, fall_back_language) end |