Class: RVGP::Journal::Posting::Transfer

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(account, opts = {}) ⇒ Transfer

Create a complex commodity, from constituent parts

Parameters:

  • account (String)

    see #account

  • opts (Hash) (defaults to: {})

    Additional parts of this Transfer

Options Hash (opts):



45
46
47
48
49
50
# File 'lib/rvgp/journal/posting.rb', line 45

def initialize(, opts = {})
  @account = 
  @commodity = opts[:commodity]
  @complex_commodity = opts[:complex_commodity]
  @tags = opts[:tags] || []
end

Instance Attribute Details

#accountString (readonly)

The account this posting is crediting or debiting

Returns:

  • (String)

    the current value of account



36
37
38
# File 'lib/rvgp/journal/posting.rb', line 36

def 
  @account
end

#commodityString (readonly)

The amount (expressed in commodity terms) being credit/debited

Returns:

  • (String)

    the current value of commodity



36
37
38
# File 'lib/rvgp/journal/posting.rb', line 36

def commodity
  @commodity
end

#complex_commodityString (readonly)

The amount (expressed in complex commodity terms) being credit/debited

Returns:

  • (String)

    the current value of complex_commodity



36
37
38
# File 'lib/rvgp/journal/posting.rb', line 36

def complex_commodity
  @complex_commodity
end

#tagsArray<RVGP::Journal::Posting::Tag> (readonly)

An array of tags, that apply to this posting.

Returns:



36
37
38
# File 'lib/rvgp/journal/posting.rb', line 36

def tags
  @tags
end