diff --git a/lib/learn_worlds.rb b/lib/learn_worlds.rb index 27378d0..c386c81 100644 --- a/lib/learn_worlds.rb +++ b/lib/learn_worlds.rb @@ -9,7 +9,7 @@ module LearnWorlds autoload :Collection, "learn_worlds/collection" autoload :Configuration, "learn_worlds/configuration" - autoload :User, "learn_worlds/objects/user" + autoload :UserObject, "learn_worlds/objects/user_object" autoload :Resource, "learn_worlds/resource" autoload :UserResource, "learn_worlds/resources/user_resource" diff --git a/lib/learn_worlds/objects/user.rb b/lib/learn_worlds/objects/user_object.rb similarity index 50% rename from lib/learn_worlds/objects/user.rb rename to lib/learn_worlds/objects/user_object.rb index 539065b..24c7bbd 100644 --- a/lib/learn_worlds/objects/user.rb +++ b/lib/learn_worlds/objects/user_object.rb @@ -1,4 +1,4 @@ module LearnWorlds - class User < Object + class UserObject < Object end end diff --git a/lib/learn_worlds/resources/user_resource.rb b/lib/learn_worlds/resources/user_resource.rb index 335ae25..578a7a3 100644 --- a/lib/learn_worlds/resources/user_resource.rb +++ b/lib/learn_worlds/resources/user_resource.rb @@ -4,15 +4,15 @@ class UserResource < Resource def list(**params) response = get_request(ENDPOINT, params) - Collection.from_response(response, key: "data", type: User) + Collection.from_response(response, key: "data", type: UserObject) end def create(**attributes) - User.new(post_request(ENDPOINT, attributes).body) + UserObject.new(post_request(ENDPOINT, attributes).body) end def find(user_id:) - User.new(get_request("#{ENDPOINT}/#{user_id}").body) + UserObject.new(get_request("#{ENDPOINT}/#{user_id}").body) end def update(user_id:, **params)