Class: CO2Equivalents::Citation

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, deets = {}) ⇒ Citation

Returns a new instance of Citation.



5
6
7
8
9
10
# File 'lib/co2_equivalents/citation.rb', line 5

def initialize(url, deets = {})
  self.url = url
  deets.each do |deet, value|
    self.send "#{deet}=", value
  end
end

Instance Attribute Details

#authorObject

Returns the value of attribute author.



3
4
5
# File 'lib/co2_equivalents/citation.rb', line 3

def author
  @author
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/co2_equivalents/citation.rb', line 3

def title
  @title
end

#urlObject

Returns the value of attribute url.



3
4
5
# File 'lib/co2_equivalents/citation.rb', line 3

def url
  @url
end