Class: HeatingEnvironment
- Inherits:
-
Object
- Object
- HeatingEnvironment
- Includes:
- ActiveModel::Serialization
- Defined in:
- app/models/heating_environment.rb
Overview
A high-level environment a heating system can be installed into
(e.g. "indoor floor", "outdoor snow melt", "roof deicing") that maps
the public-facing environment name onto its key and the canonical
product-line URL the public site routes the visitor to.
Backed by the static lookup at
HeatingElementProductLineOption::PUBLIC_ENVIRONMENTS_HASH.
Instance Attribute Summary collapse
-
#base_product_line_url ⇒ Object
readonly
Returns the value of attribute base_product_line_url.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(environment_name) ⇒ HeatingEnvironment
constructor
A new instance of HeatingEnvironment.
Constructor Details
#initialize(environment_name) ⇒ HeatingEnvironment
Returns a new instance of HeatingEnvironment.
14 15 16 17 18 19 20 21 22 23 |
# File 'app/models/heating_environment.rb', line 14 def initialize(environment_name) if (env_hash = HeatingElementProductLineOption::PUBLIC_ENVIRONMENTS_HASH[environment_name]).present? @name = environment_name @key = env_hash[:key] @base_product_line_url = env_hash[:base_product_line_url] true else false end end |
Instance Attribute Details
#base_product_line_url ⇒ Object (readonly)
Returns the value of attribute base_product_line_url.
12 13 14 |
# File 'app/models/heating_environment.rb', line 12 def base_product_line_url @base_product_line_url end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
12 13 14 |
# File 'app/models/heating_environment.rb', line 12 def key @key end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'app/models/heating_environment.rb', line 12 def name @name end |