Class: Kentaa::Api::Resources::Users

Inherits:
List
  • Object
show all
Defined in:
lib/kentaa/api/resources/users.rb

Instance Attribute Summary

Attributes inherited from Base

#config, #endpoint_path, #options, #resource_class

Instance Method Summary collapse

Methods inherited from List

#[], #all, #create, #current_page, #delete, #each, #get, #links, #next, #next_page, #next_page?, #pages, #per_page, #previous, #previous_page, #previous_page?, #size, #total_entries, #total_pages, #update

Methods inherited from Base

attribute_key, #load, #loaded?

Constructor Details

#initialize(config, options = {}) ⇒ Users

Returns a new instance of Users.



7
8
9
# File 'lib/kentaa/api/resources/users.rb', line 7

def initialize(config, options = {})
  super(config, options.merge(resource_class: Kentaa::Api::Resources::User, endpoint_path: '/users'))
end

Instance Method Details

#auth(attributes, options = {}) ⇒ Object



11
12
13
14
# File 'lib/kentaa/api/resources/users.rb', line 11

def auth(attributes, options = {})
  resource = resource_class.new(config, options: options)
  resource.load { request.post("#{endpoint_path}/auth", options, attributes) }
end