Class: SecondAmendmentWholesale::Attribute

Inherits:
Base
  • Object
show all
Includes:
API
Defined in:
lib/second_amendment_wholesale/attribute.rb

Constant Summary

Constants included from API

SecondAmendmentWholesale::API::ROOT_API_URL

Class Method Summary collapse

Instance Method Summary collapse

Methods included from API

#delete_request, #get_request, #post_request, #put_request

Constructor Details

#initialize(options = {}) ⇒ Attribute



6
7
8
9
10
# File 'lib/second_amendment_wholesale/attribute.rb', line 6

def initialize(options = {})
  requires!(options, :token)

  @options = options
end

Class Method Details

.all(options = {}) ⇒ Object



12
13
14
15
16
# File 'lib/second_amendment_wholesale/attribute.rb', line 12

def self.all(options = {})
  requires!(options, :token)

  new(options).all
end

Instance Method Details

#allObject



18
19
20
21
22
23
24
25
# File 'lib/second_amendment_wholesale/attribute.rb', line 18

def all
  headers = [ 
    *auth_header(@options[:token]),
    *content_type_header('application/json'),
  ].to_h

  get_request('feed/attributes', headers).body
end