hookercookerman-amee 0.0.5 → 0.0.6

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.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.5'
36
+ VERSION = '0.0.6'
37
37
  end
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 = {"profile_items" => data["children"].delete("profileItems")}
59
+ profile_items = {"data_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
@@ -15,16 +15,20 @@ module Amee
15
15
  end
16
16
 
17
17
  def create_profile_data_item(path_or_category, data_item_uid, params = {})
18
- path = self.full_path + path_or_category.is_a?(String) ? "/#{path_or_category}" : "/#{path_or_category.full_path}"
18
+ path = full_path + path_or_category.is_a?(String) ? "/#{path_or_category}" : "/#{path_or_category.full_path}"
19
19
  Amee::ProfileApi::ProfileDataItem.create(session, path, data_item_uid, params)
20
20
  end
21
21
 
22
22
  def get_profile_item(path, options = {})
23
- session.get_profile_item(path, options)
23
+ session.get_profile_item((full_path + path), options)
24
+ end
25
+
26
+ def get_profile_category(path, options = {})
27
+ session.get_profile_category((full_path + path), options)
24
28
  end
25
29
 
26
30
  def update_profile_item(path, fields)
27
- session.update_profile_item(full_path, :fields => fields)
31
+ session.update_profile_item((full_path + path), :fields => fields)
28
32
  end
29
33
 
30
34
  def destroy
data/lib/amee/service.rb CHANGED
@@ -5,6 +5,8 @@ module Amee
5
5
  base_uri Amee::Config[:server]
6
6
  format :json
7
7
 
8
+ attr_accessor :auth_token
9
+
8
10
  def initialize(auth_token)
9
11
  @auth_token = auth_token
10
12
  end
data/lib/amee/session.rb CHANGED
@@ -7,7 +7,7 @@ module Amee
7
7
  class PermissionDenied < StandardError; end
8
8
  class NotFound < StandardError; end
9
9
  class UnknownError < StandardError; end
10
- attr_accessor :auth_token, :cache
10
+ attr_accessor :auth_token, :cache, :service
11
11
 
12
12
  def self.create(username = nil, password = nil)
13
13
  username ||= Amee::Config[:username]
@@ -40,6 +40,7 @@ module Amee
40
40
  unless @auth_token = Amee::Service.auth_token(@username, @password, Amee::Config[:auth_path])
41
41
  raise Amee::Session::UnAuthorized.new "Please provide your correct username and password. "
42
42
  end
43
+ service.auth_token = @auth_token
43
44
  end
44
45
 
45
46
  def authenticated?
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.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Hooker