Class: Beanie::VatRecord

Inherits:
Api
  • Object
show all
Defined in:
lib/beanie/vat_record.rb

Constant Summary collapse

TYPE_SALES =
0
TYPE_PURCHASES =
1
TYPE_GOODS_FROM =
2
TYPE_GOODS_TO =
3
TYPE_SERVICES_FROM =
4
TYPE_SERVICES_TO =
5
TYPE_NAMES =
[
  ["Sales", TYPE_SALES],
  ["Purchases", TYPE_PURCHASES],
  ["Goods From", TYPE_GOODS_FROM],
  ["Goods To", TYPE_GOODS_TO],
  ["Services From", TYPE_SERVICES_FROM],
  ["Services To", TYPE_SERVICES_TO]
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Api

all, build_url, #construct_path, delete, #extract, #field_name, find, get, #object_name, #populate, post, put, #save!, set_headers

Constructor Details

#initializeVatRecord

Initialize instance variables



52
53
54
55
56
57
58
# File 'lib/beanie/vat_record.rb', line 52

def initialize
  @id = nil
  @amount = nil
  @record_type = nil
  @vat_return_id = nil
  @sales_tax_rate = nil
end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



32
33
34
# File 'lib/beanie/vat_record.rb', line 32

def amount
  @amount
end

#idObject

Returns the value of attribute id.



32
33
34
# File 'lib/beanie/vat_record.rb', line 32

def id
  @id
end

#record_typeObject

Returns the value of attribute record_type.



32
33
34
# File 'lib/beanie/vat_record.rb', line 32

def record_type
  @record_type
end

#sales_tax_rateObject

Returns the value of attribute sales_tax_rate.



32
33
34
# File 'lib/beanie/vat_record.rb', line 32

def sales_tax_rate
  @sales_tax_rate
end

#vat_return_idObject

Returns the value of attribute vat_return_id.



32
33
34
# File 'lib/beanie/vat_record.rb', line 32

def vat_return_id
  @vat_return_id
end

Instance Method Details

#record_type_nameObject

Conver the record type into a string



62
63
64
# File 'lib/beanie/vat_record.rb', line 62

def record_type_name
  TYPE_NAMES[self.record_type][0]
end