Class: Hangry::RecipeAttributeCleaner
- Inherits:
-
Object
- Object
- Hangry::RecipeAttributeCleaner
- Defined in:
- lib/hangry/recipe_attribute_cleaner.rb
Constant Summary collapse
- MULTILINE_ATTRIBUTES =
[:instructions]
Instance Attribute Summary collapse
-
#recipe ⇒ Object
readonly
Returns the value of attribute recipe.
Instance Method Summary collapse
- #clean ⇒ Object
-
#initialize(recipe) ⇒ RecipeAttributeCleaner
constructor
A new instance of RecipeAttributeCleaner.
Constructor Details
#initialize(recipe) ⇒ RecipeAttributeCleaner
Returns a new instance of RecipeAttributeCleaner.
8 9 10 |
# File 'lib/hangry/recipe_attribute_cleaner.rb', line 8 def initialize(recipe) @recipe = recipe end |
Instance Attribute Details
#recipe ⇒ Object (readonly)
Returns the value of attribute recipe.
6 7 8 |
# File 'lib/hangry/recipe_attribute_cleaner.rb', line 6 def recipe @recipe end |
Instance Method Details
#clean ⇒ Object
12 13 14 15 16 17 |
# File 'lib/hangry/recipe_attribute_cleaner.rb', line 12 def clean RECIPE_ATTRIBUTES.each do |attribute| recipe.public_send("#{attribute}=", clean_attribute(recipe, attribute)) end recipe end |