class IngredientDecorator < BaseDecorator

  def ndbn_check
    if ndbn.present?
      "<span class =\"glyphicon glyphicon-ok\"></span>".html_safe
    else
      ''
    end
  end

  def density
    if wrapped.density.present?
      value = UnitConversion::parse(wrapped.density)
      value.convert('oz/cup').change_formatter(UnitConversion::DecimalFormatter.new).pretty_value
    end
  end
end