lib/amee/profile.rb in Floppy-amee-2.0.7 vs lib/amee/profile.rb in Floppy-amee-2.0.8
- old
+ new
@@ -2,11 +2,11 @@
module Profile
class Profile < AMEE::Profile::Object
def self.list(connection)
# Load data from path
- response = connection.get('/profiles')
+ response = connection.get('/profiles').body
# Parse data from response
profiles = []
if response.is_json?
# Read JSON
doc = JSON.parse(response)
@@ -46,10 +46,10 @@
raise AMEE::BadData.new("Couldn't load Profile list.")
end
def self.create(connection)
# Create new profile
- response = connection.post('/profiles', :profile => true)
+ response = connection.post('/profiles', :profile => true).body
# Parse data from response
if response.is_json?
# Read JSON
doc = JSON.parse(response)
p = doc['profile']