Class: Beanie::NominalAccount

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

Constant Summary collapse

TYPE_FIXED_ASSETS =
0
TYPE_CURRENT_ASSETS =
1
TYPE_CURRENT_LIABILITIES =
2
TYPE_NON_CURRENT_LIABILITIES =
3
TYPE_RESERVES =
4
TYPE_INCOME =
5
TYPE_DIRECT_COSTS =
6
TYPE_EXPENSE =
7
TYPE_OTHER_EXPENSE =
8
TYPE_OTHER_INCOME =
9
TYPE_NAMES =
[
  ["Fixed Assets", TYPE_FIXED_ASSETS],
  ["Current Assets", TYPE_CURRENT_ASSETS],
  ["Current Liabilities", TYPE_CURRENT_LIABILITIES],
  ["Non-Current Liabilities", TYPE_NON_CURRENT_LIABILITIES],
  ["Reserves", TYPE_RESERVES],
  ["Income", TYPE_INCOME],
  ["Direct Costs", TYPE_DIRECT_COSTS],
  ["Expense", TYPE_EXPENSE],
  ["Other Expense", TYPE_OTHER_EXPENSE],
  ["Other Income", TYPE_OTHER_INCOME]
].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

#initializeNominalAccount

Initialize instance variables



60
61
62
63
64
65
# File 'lib/beanie/nominal_account.rb', line 60

def initialize
  @id = nil
  @code = nil
  @name = nil
  @nominal_account_category_id = nil
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



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

def code
  @code
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#na_typeObject

Returns the value of attribute na_type.



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

def na_type
  @na_type
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#nominal_account_category_idObject

Returns the value of attribute nominal_account_category_id.



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

def 
  @nominal_account_category_id
end

Instance Method Details

#type_nameObject

Show proper name for type



69
70
71
# File 'lib/beanie/nominal_account.rb', line 69

def type_name
  TYPE_NAMES[na_type][0]
end