Class: WaffleCal::ProdId
- Inherits:
-
Object
- Object
- WaffleCal::ProdId
- Defined in:
- lib/waffle_cal/prod_id.rb
Instance Attribute Summary collapse
-
#entity_name ⇒ Object
Returns the value of attribute entity_name.
-
#language ⇒ Object
Returns the value of attribute language.
-
#product_name ⇒ Object
Returns the value of attribute product_name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ ProdId
constructor
A new instance of ProdId.
- #to_s ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ ProdId
Returns a new instance of ProdId.
6 7 8 9 10 |
# File 'lib/waffle_cal/prod_id.rb', line 6 def initialize(attrs={}) @entity_name = attrs[:entity_name] @product_name = attrs[:product_name] @language = attrs[:language].upcase if attrs.has_key?(:language) end |
Instance Attribute Details
#entity_name ⇒ Object
Returns the value of attribute entity_name.
4 5 6 |
# File 'lib/waffle_cal/prod_id.rb', line 4 def entity_name @entity_name end |
#language ⇒ Object
Returns the value of attribute language.
4 5 6 |
# File 'lib/waffle_cal/prod_id.rb', line 4 def language @language end |
#product_name ⇒ Object
Returns the value of attribute product_name.
4 5 6 |
# File 'lib/waffle_cal/prod_id.rb', line 4 def product_name @product_name end |
Class Method Details
Instance Method Details
#to_s ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/waffle_cal/prod_id.rb', line 16 def to_s if complete? "//#{@entity_name}//#{@product_name}//#{@language}" else default_prod_id.to_s end end |