hookercookerman-amee 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/amee.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{amee}
5
- s.version = '0.1.4'
5
+ s.version = '0.1.5'
6
6
 
7
7
  s.homepage = 'http://github.com/hookercookerman/amee/tree/master'
8
8
  s.description = %q{Its a gem to interact with the amee api}
data/lib/amee.rb CHANGED
@@ -36,5 +36,5 @@ require "amee/profile_api/profile_category"
36
36
  require "amee/profile_api/profile"
37
37
 
38
38
  module Amee
39
- VERSION = '0.1.4'
39
+ VERSION = '0.1.5'
40
40
  end
@@ -8,11 +8,19 @@ module Amee
8
8
  self.path_prefix = "/data"
9
9
 
10
10
 
11
- attr_accessor :start_date, :end_date, :label, :choices, :kg_c_o2_per_k_wh, :source, :amount_per_month
11
+ attr_accessor :start_date, :end_date, :label, :choices, :kg_c_o2_per_k_wh, :source, :amount_per_month, :amount
12
12
  list_populators :item_values => {:class => Amee::DataApi::DataItemValue}
13
13
  item_populators :data_category => {:class => Amee::DataApi::DataCategory},
14
14
  :item_definition => {:class => Amee::DataApi::ItemDefinition}
15
-
15
+
16
+ def co2_unit
17
+ amount["unit"] if amount
18
+ end
19
+
20
+ def co2_value
21
+ amount["value"] if amount
22
+ end
23
+
16
24
  def populate!
17
25
  session.api_call(:get, "data.item", self.full_path) do |response|
18
26
  populate_from_hash!(response)
data/lib/amee/parser.rb CHANGED
@@ -29,6 +29,7 @@ module Amee
29
29
  item_values = {"item_values" => data["dataItem"].delete("itemValues")}
30
30
  data_item.merge(item_values).
31
31
  merge({"choices" => data["userValueChoices"]["choices"]}).
32
+ merge({"amount" => data["amount"]}).
32
33
  merge({"resource_path" => data["path"]})
33
34
  end
34
35
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hookercookerman-amee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Hooker