Class: CO2Equivalents::Equivalent
- Inherits:
-
Object
- Object
- CO2Equivalents::Equivalent
- Defined in:
- lib/co2_equivalents/equivalent.rb
Instance Attribute Summary collapse
-
#factor ⇒ Object
Returns the value of attribute factor.
-
#group ⇒ Object
Returns the value of attribute group.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(group, name, factor) ⇒ Equivalent
constructor
A new instance of Equivalent.
Constructor Details
#initialize(group, name, factor) ⇒ Equivalent
Returns a new instance of Equivalent.
7 8 9 10 11 |
# File 'lib/co2_equivalents/equivalent.rb', line 7 def initialize(group, name, factor) self.group = group.to_s.underscore.to_sym self.name = name self.factor = factor end |
Instance Attribute Details
#factor ⇒ Object
Returns the value of attribute factor.
5 6 7 |
# File 'lib/co2_equivalents/equivalent.rb', line 5 def factor @factor end |
#group ⇒ Object
Returns the value of attribute group.
5 6 7 |
# File 'lib/co2_equivalents/equivalent.rb', line 5 def group @group end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/co2_equivalents/equivalent.rb', line 5 def name @name end |