Class: InciScore::Ingredient

Inherits:
Object
  • Object
show all
Defined in:
lib/inci_score/ingredient.rb

Constant Summary collapse

SLASH_RULE =
/(?<!ate)\//.freeze
PARENTHESIS =
%w[( ) [ ]].freeze
PARENTHESIS_RULE =
/(\(.+\)|\[.+\])/.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#rawObject (readonly)

Returns the value of attribute raw.



9
10
11
# File 'lib/inci_score/ingredient.rb', line 9

def raw
  @raw
end

#valuesObject (readonly)

Returns the value of attribute values.



9
10
11
# File 'lib/inci_score/ingredient.rb', line 9

def values
  @values
end