Class: Facturama::Services::CatalogService

Inherits:
CrudService show all
Defined in:
lib/facturama/services/catalog_service.rb

Instance Method Summary collapse

Methods inherited from CrudService

#create, #create3, #list, #remove, #retrieve, #update

Methods inherited from HttpService

#delete, #get, #post, #put

Constructor Details

#initialize(connection_info) ⇒ CatalogService

Returns a new instance of CatalogService.



8
9
10
# File 'lib/facturama/services/catalog_service.rb', line 8

def initialize(connection_info)
  super(connection_info, 'catalogs')
end

Instance Method Details

#cfdi_typesObject



54
55
56
# File 'lib/facturama/services/catalog_service.rb', line 54

def cfdi_types
  get('cfditypes')
end

#cfdi_uses(keyword = '') ⇒ Object



62
63
64
# File 'lib/facturama/services/catalog_service.rb', line 62

def cfdi_uses(keyword = '')
  get("cfdiuses?keyword=#{keyword}")
end

#countries(keyword = '') ⇒ Object



46
47
48
# File 'lib/facturama/services/catalog_service.rb', line 46

def countries(keyword = '')
  get("countries?keyword=#{keyword}")
end

#currencies(keyword = nil) ⇒ Object



25
26
27
28
# File 'lib/facturama/services/catalog_service.rb', line 25

def currencies(keyword = nil)
  parameters = keyword.to_s.empty? ? '' : "?keyword=#{keyword}"
  get("currencies#{parameters}")
end

#federal_taxesObject



50
51
52
# File 'lib/facturama/services/catalog_service.rb', line 50

def federal_taxes
  get('federaltaxes')
end

#fiscal_regimensObject



38
39
40
# File 'lib/facturama/services/catalog_service.rb', line 38

def fiscal_regimens
  get('fiscalregimens')
end

#localities(state_code) ⇒ Object



74
75
76
# File 'lib/facturama/services/catalog_service.rb', line 74

def localities state_code
  get("localities?keyword=#{state_code}")
end

#municipalities(state_code) ⇒ Object



70
71
72
# File 'lib/facturama/services/catalog_service.rb', line 70

def municipalities state_code
  get("municipalities?keyword=#{state_code}")
end

#name_idsObject



17
18
19
# File 'lib/facturama/services/catalog_service.rb', line 17

def name_ids
  get('NameIds')
end

#neighborhoods(postal_code) ⇒ Object



78
79
80
# File 'lib/facturama/services/catalog_service.rb', line 78

def neighborhoods postal_code
  get("neighborhoods?keyword=#{postal_code}")
end

#payment_formsObject



30
31
32
# File 'lib/facturama/services/catalog_service.rb', line 30

def payment_forms
  get('paymentforms')
end

#payment_methodsObject



34
35
36
# File 'lib/facturama/services/catalog_service.rb', line 34

def payment_methods
  get('paymentmethods')
end

#postal_codesObject



42
43
44
# File 'lib/facturama/services/catalog_service.rb', line 42

def postal_codes
  get('postalcodes')
end

#products_or_services(keyword) ⇒ Object



21
22
23
# File 'lib/facturama/services/catalog_service.rb', line 21

def products_or_services(keyword)
  get("ProductsOrServices?keyword=#{keyword}")
end

#relation_typesObject



58
59
60
# File 'lib/facturama/services/catalog_service.rb', line 58

def relation_types
  get('relationtypes')
end

#states(country) ⇒ Object



66
67
68
# File 'lib/facturama/services/catalog_service.rb', line 66

def states(country)
  get("states?keyword=#{country}")
end

#units(keyword = nil) ⇒ Object



12
13
14
15
# File 'lib/facturama/services/catalog_service.rb', line 12

def units(keyword = nil)
  parameters = keyword.to_s.empty? ? '' : "?keyword=#{keyword}"
  get("units#{parameters}")
end