Class: Qif::Transaction::Split::Builder

Inherits:
Object
  • Object
show all
Includes:
Builderable
Defined in:
lib/qif/transaction/split/builder.rb

Overview

Factory class for buliding splits. Do not construct this directly, rather use Qif::Transaction::Builder#add_split

Instance Method Summary collapse

Methods included from Builderable

#_build, included

Constructor Details

#initialize(transaction_builder) {|_self| ... } ⇒ Builder

Returns a new instance of Builder.

Yields:

  • (_self)

Yield Parameters:



11
12
13
14
# File 'lib/qif/transaction/split/builder.rb', line 11

def initialize(transaction_builder)
  @transaction_builder = transaction_builder
  yield self if block_given?
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



29
30
31
# File 'lib/qif/transaction/split/builder.rb', line 29

def method_missing(name, *args, &block)
  @transaction_builder.send(name, *args, &block)
end

Instance Method Details

#add_split(split_memo) ⇒ Object



16
17
18
# File 'lib/qif/transaction/split/builder.rb', line 16

def add_split(split_memo)
  @transaction_builder.add_split(split_memo)
end

#build_splitObject



25
26
27
# File 'lib/qif/transaction/split/builder.rb', line 25

def build_split
  _build(Qif::Transaction::Split.new)
end