lib/kentaa/api/resources/user.rb in kentaa-api-0.4.0 vs lib/kentaa/api/resources/user.rb in kentaa-api-0.5.0

- old
+ new

@@ -8,10 +8,14 @@ class User < Resource def object_key "User_#{id}" end + def site + Kentaa::Api::Resources::Site.new(config, id: site_id, options: options) + end + def site_id data[:site_id] end def first_name @@ -73,11 +77,11 @@ def phone data[:phone] end def birthday - Time.parse(data[:birthday]) if data[:birthday] + Date.parse(data[:birthday]) if data[:birthday] end def gender data[:gender] end @@ -86,9 +90,15 @@ data[:locale] end def consent @consent ||= Kentaa::Api::Resources::Consent.new(data[:consent]) if data[:consent] + end + + def auth(attributes) + @response = request.post("/users/auth", options, attributes) + + self end private def load_resource