Class: PrintfulAPI::Country

Inherits:
APIResource show all
Includes:
APIOperations::List
Defined in:
lib/printful_api/country.rb

Instance Attribute Summary

Attributes inherited from APIResource

#raw_data

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::List

included

Methods inherited from APIResource

api_attributes, belongs_to, camelize, has_many, #load_data, singularize, #to_h

Class Method Details

.list(filters = {}, opts = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/printful_api/country.rb', line 9

def self.list( filters={}, opts={} )
	taxable = filters.delete(:taxable)

	puts "Country.list taxable: #{taxable}, #{filters}, #{opts}"

	if taxable
		super( filters, opts.merge( resource_path: '/tax/countries' ) )
	else
		super( filters, opts )
	end
end

.resource_pathObject



25
26
27
# File 'lib/printful_api/country.rb', line 25

def self.resource_path
	'/countries'
end

Instance Method Details

#statesObject



21
22
23
# File 'lib/printful_api/country.rb', line 21

def states
	@states
end