hookercookerman-amee 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/amee.rb +1 -1
- data/lib/amee/parser.rb +1 -1
- data/lib/amee/profile_api/profile.rb +7 -3
- data/lib/amee/service.rb +2 -0
- data/lib/amee/session.rb +2 -1
- metadata +1 -1
data/lib/amee.rb
CHANGED
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 = {"
|
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 =
|
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
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?
|