Class: RVGP::Journal::Posting::Transfer
- Inherits:
-
Object
- Object
- RVGP::Journal::Posting::Transfer
- Defined in:
- lib/rvgp/journal/posting.rb
Overview
This class represents an indented ‘transfer’ line, within a posting. Typically, such lines takes the form of : “‘
Personal:Expenses:Food:Groceries $ 50.00
“‘ This class offers few functions, and mostly just offers its attributes. Note that there should be no reason a posting ever has both is commodity and complex_commodity set. Either one or the other should exist, for any given Transfer.
Instance Attribute Summary collapse
-
#account ⇒ String
readonly
The account this posting is crediting or debiting.
-
#commodity ⇒ String
readonly
The amount (expressed in commodity terms) being credit/debited.
-
#complex_commodity ⇒ String
readonly
The amount (expressed in complex commodity terms) being credit/debited.
-
#tags ⇒ Array<RVGP::Journal::Posting::Tag>
readonly
An array of tags, that apply to this posting.
Instance Method Summary collapse
-
#initialize(account, opts = {}) ⇒ Transfer
constructor
Create a complex commodity, from constituent parts.
Constructor Details
#initialize(account, opts = {}) ⇒ Transfer
Create a complex commodity, from constituent parts
45 46 47 48 49 50 |
# File 'lib/rvgp/journal/posting.rb', line 45 def initialize(account, opts = {}) @account = account @commodity = opts[:commodity] @complex_commodity = opts[:complex_commodity] @tags = opts[:tags] || [] end |
Instance Attribute Details
#account ⇒ String (readonly)
The account this posting is crediting or debiting
36 37 38 |
# File 'lib/rvgp/journal/posting.rb', line 36 def account @account end |
#commodity ⇒ String (readonly)
The amount (expressed in commodity terms) being credit/debited
36 37 38 |
# File 'lib/rvgp/journal/posting.rb', line 36 def commodity @commodity end |
#complex_commodity ⇒ String (readonly)
The amount (expressed in complex commodity terms) being credit/debited
36 37 38 |
# File 'lib/rvgp/journal/posting.rb', line 36 def complex_commodity @complex_commodity end |
#tags ⇒ Array<RVGP::Journal::Posting::Tag> (readonly)
An array of tags, that apply to this posting.
36 37 38 |
# File 'lib/rvgp/journal/posting.rb', line 36 def @tags end |