Class: Wes::Data::API::CreatorUser

Inherits:
Object
  • Object
show all
Extended by:
Base
Defined in:
lib/wes/data/api/creator_user.rb

Class Method Summary collapse

Methods included from Base

add_state, client, configuration, map_objects, routes

Class Method Details

.allObject



11
12
13
14
15
# File 'lib/wes/data/api/creator_user.rb', line 11

def all
  map_objects(
    client.get(routes.creator_users), model_klass
  )
end

.create(id) ⇒ Object



17
18
19
20
21
# File 'lib/wes/data/api/creator_user.rb', line 17

def create(id)
  route = [routes.creator_user, id].join("/")
  attributes = client.post(route, {}).first
  attributes.nil? ? nil : model_klass.new(attributes)
end

.find(key, value) ⇒ Object



23
24
25
26
# File 'lib/wes/data/api/creator_user.rb', line 23

def find(key, value)
  attributes = client.get(find_route(key, value)).first
  attributes.nil? ? nil : model_klass.new(attributes)
end