25 lines
326 B
Ruby
25 lines
326 B
Ruby
class IngredientProxy
|
|
|
|
attr_reader :ingredient
|
|
|
|
def initialize(food)
|
|
@food = food
|
|
end
|
|
|
|
def name
|
|
@food.name
|
|
end
|
|
|
|
def density
|
|
@food.density
|
|
end
|
|
|
|
def density?
|
|
@food.density.present?
|
|
end
|
|
|
|
def get_custom_unit_equivalent(custom_unit_name)
|
|
@food.custom_unit_weight(custom_unit_name)
|
|
end
|
|
|
|
end |