Class: CO2Equivalents::Equivalent

Inherits:
Object
  • Object
show all
Defined in:
lib/co2_equivalents/equivalent.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#factorObject

Returns the value of attribute factor.



5
6
7
# File 'lib/co2_equivalents/equivalent.rb', line 5

def factor
  @factor
end

#groupObject

Returns the value of attribute group.



5
6
7
# File 'lib/co2_equivalents/equivalent.rb', line 5

def group
  @group
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/co2_equivalents/equivalent.rb', line 5

def name
  @name
end