Class: Wes::Data::API::Brand

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

Class Method Summary collapse

Methods included from Base

add_state, apply_pagination, client, configuration, map_objects, routes

Class Method Details

.allObject



11
12
13
# File 'lib/wes/data/api/brand.rb', line 11

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

.find(_key, value) ⇒ Object



15
16
17
18
19
# File 'lib/wes/data/api/brand.rb', line 15

def find(_key, value)
  route = [routes.brand, value].join('/')
  attributes = client.get(route).first
  attributes.nil? ? nil : model_klass.new(attributes)
end