hookercookerman-amee 0.0.6 → 0.0.7

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/lib/amee/parser.rb CHANGED
@@ -56,7 +56,7 @@ module Amee
56
56
  class ProfileCategory < Parser
57
57
  def self.process(data)
58
58
  profile_categories = {"profile_categories" => data["children"].delete("dataCategories")}
59
- profile_items = {"data_items" => data["children"]["profileItems"].delete("rows")} if data["children"]["profileItems"]
59
+ profile_items = {"profile_items" => data["children"]["profileItems"].delete("rows")} if data["children"]["profileItems"]
60
60
  data.merge(profile_items).merge(profile_categories).
61
61
  merge({"resource_path" => data["path"]})
62
62
  end
@@ -98,7 +98,7 @@ module Amee
98
98
 
99
99
  class CreateProfileItem < Parser
100
100
  def self.process(data)
101
- data
101
+ data["profileItem"].merge({"resource_path" => data["path"]})
102
102
  end
103
103
  end
104
104
 
@@ -6,7 +6,7 @@ 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, :data_item, :amount_per_month, :total_amount
9
+ attr_accessor :end, :amount, :data_item, :profile, :valid_from, :start_date, :end_date, :amount_per_month, :total_amount
10
10
 
11
11
  list_populators :item_values => {:class => Amee::DataApi::DataItemValue}
12
12
  item_populators :data_category => {:class => Amee::DataApi::DataCategory},
data/lib/amee/session.rb CHANGED
@@ -154,9 +154,8 @@ module Amee
154
154
  def create_profile_item(path, uid, options = {})
155
155
  @cache.clear
156
156
  api_call(:post, "create.profile_item", path,
157
- :query => {:dataItemUid => uid}.merge(options[:fields])) do |response|
158
- location = response.headers["location"]
159
- location.is_a?(Array) ? location.first : location
157
+ :query => {:dataItemUid => uid, :representation => "full"}.merge(options[:fields])) do |response|
158
+ Amee::ProfileApi::ProfileItem.from_hash(response, self)
160
159
  end
161
160
  end
162
161
 
data/lib/amee.rb CHANGED
@@ -33,5 +33,5 @@ require "amee/profile_api/profile_category"
33
33
  require "amee/profile_api/profile"
34
34
 
35
35
  module Amee
36
- VERSION = '0.0.6'
36
+ VERSION = '0.0.7'
37
37
  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.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Hooker