Class: Wes::Data::API::BrandUser
- Inherits:
-
Object
- Object
- Wes::Data::API::BrandUser
show all
- Extended by:
- Base
- Defined in:
- lib/wes/data/api/brand_user.rb
Class Method Summary
collapse
Methods included from Base
add_state, apply_pagination, client, configuration, map_objects, routes
Class Method Details
.create(data) ⇒ Object
11
12
13
14
|
# File 'lib/wes/data/api/brand_user.rb', line 11
def create(data)
attributes = client.post(routes.brand_user, data).first
attributes.nil? ? nil : model_klass.new(attributes)
end
|
.find(_key, value) ⇒ Object
16
17
18
19
20
|
# File 'lib/wes/data/api/brand_user.rb', line 16
def find(_key, value)
route = [routes.brand_user, value].join('/')
attributes = client.get(route).first
attributes.nil? ? nil : model_klass.new(attributes)
end
|
.find_by_auth0_id(value) ⇒ Object
22
23
24
25
26
|
# File 'lib/wes/data/api/brand_user.rb', line 22
def find_by_auth0_id(value)
route = "#{routes.brand_user}?auth0_id=#{value}"
attributes = client.get(route).first
attributes.nil? ? nil : model_klass.new(attributes)
end
|