Class: Countir::Journal::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/countir/resources/journal.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account_code_id:, debit_or_credit:, price:) ⇒ Entry

Returns a new instance of Entry.



8
9
10
11
12
# File 'lib/countir/resources/journal.rb', line 8

def initialize(account_code_id:, debit_or_credit:, price:)
  self. = 
  self.debit_or_credit = debit_or_credit
  self.price           = price
end

Instance Attribute Details

#account_code_idObject

Returns the value of attribute account_code_id.



6
7
8
# File 'lib/countir/resources/journal.rb', line 6

def 
  @account_code_id
end

#debit_or_creditObject

Returns the value of attribute debit_or_credit.



6
7
8
# File 'lib/countir/resources/journal.rb', line 6

def debit_or_credit
  @debit_or_credit
end

#priceObject

Returns the value of attribute price.



6
7
8
# File 'lib/countir/resources/journal.rb', line 6

def price
  @price
end

Instance Method Details

#to_hObject



14
15
16
17
18
19
# File 'lib/countir/resources/journal.rb', line 14

def to_h
  { account_code_id: self.,
    debit_or_credit: self.debit_or_credit,
    price:           self.price,
  }
end