hookercookerman-amee 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/amee/parser.rb +4 -1
- data/lib/amee/profile_api/profile_item.rb +7 -4
- data/lib/amee.rb +1 -1
- metadata +1 -1
data/lib/amee/parser.rb
CHANGED
@@ -57,6 +57,7 @@ module Amee
|
|
57
57
|
def self.process(data)
|
58
58
|
profile_categories = {"profile_categories" => data["children"].delete("dataCategories")}
|
59
59
|
profile_items = {"profile_items" => data["children"]["profileItems"].delete("rows")} if data["children"]["profileItems"]
|
60
|
+
profile_items["profile_items"].each{ |profile_item| profile_item.merge!({"profile" => data["profile"]})} if profile_items
|
60
61
|
data.merge(profile_items).merge(profile_categories).
|
61
62
|
merge({"resource_path" => data["path"]})
|
62
63
|
end
|
@@ -64,7 +65,9 @@ module Amee
|
|
64
65
|
|
65
66
|
class ProfileItem < Parser
|
66
67
|
def self.process(data)
|
67
|
-
|
68
|
+
profile_item = data["profileItem"]
|
69
|
+
item_values = {"item_values" => data["profileItem"].delete("itemValues")}
|
70
|
+
profile_item.merge(item_values).merge({"resource_path" => data["path"]})
|
68
71
|
end
|
69
72
|
end
|
70
73
|
|
@@ -6,7 +6,8 @@ module Amee
|
|
6
6
|
include Amee::Model
|
7
7
|
self.path_prefix = "/profiles"
|
8
8
|
|
9
|
-
attr_accessor :end, :amount, :data_item, :profile, :valid_from, :start_date, :end_date
|
9
|
+
attr_accessor :end, :amount, :data_item, :profile, :valid_from, :start_date, :end_date
|
10
|
+
attr_accessor :data_item_label, :data_item_uid, :amount_per_month, :total_amount
|
10
11
|
|
11
12
|
list_populators :item_values => {:class => Amee::DataApi::DataItemValue}
|
12
13
|
item_populators :data_category => {:class => Amee::DataApi::DataCategory},
|
@@ -42,9 +43,11 @@ module Amee
|
|
42
43
|
"#{self.class.path_prefix}/#{profile_uid}" + resource_path
|
43
44
|
end
|
44
45
|
|
45
|
-
|
46
|
-
|
47
|
-
|
46
|
+
def populate!
|
47
|
+
session.api_call(:get, "profile_item", self.full_path) do |response|
|
48
|
+
populate_from_hash!(response)
|
49
|
+
end
|
50
|
+
@lazy_loaded = true
|
48
51
|
end
|
49
52
|
|
50
53
|
end
|
data/lib/amee.rb
CHANGED