Class: InciScore::Ingredient
- Inherits:
-
Object
- Object
- InciScore::Ingredient
- Defined in:
- lib/inci_score/ingredient.rb
Constant Summary collapse
- SLASH_RULE =
/(?<!ate)\//.freeze
- PARENTHESIS =
%w[( ) [ ]].freeze
- PARENTHESIS_RULE =
/(\(.+\)|\[.+\])/.freeze
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
-
#initialize(raw) ⇒ Ingredient
constructor
A new instance of Ingredient.
Constructor Details
#initialize(raw) ⇒ Ingredient
Returns a new instance of Ingredient.
11 12 13 14 15 |
# File 'lib/inci_score/ingredient.rb', line 11 def initialize(raw) @raw = raw.to_s @values = fetch_values.uniq freeze end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
9 10 11 |
# File 'lib/inci_score/ingredient.rb', line 9 def raw @raw end |
#values ⇒ Object (readonly)
Returns the value of attribute values.
9 10 11 |
# File 'lib/inci_score/ingredient.rb', line 9 def values @values end |