Class: Twobook::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/twobook/entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(amount, event, transaction_id: nil, data: {}) ⇒ Entry

Returns a new instance of Entry.



5
6
7
8
9
10
11
12
13
# File 'lib/twobook/entry.rb', line 5

def initialize(amount, event, transaction_id: nil, data: {})
  @amount = Twobook.wrap_number(amount)

  raise 'Required an Event' unless event.is_a?(Event)
  @event = event

  @transaction_id = transaction_id
  @data = data
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



3
4
5
# File 'lib/twobook/entry.rb', line 3

def 
  @account
end

#amountObject (readonly)

Returns the value of attribute amount.



3
4
5
# File 'lib/twobook/entry.rb', line 3

def amount
  @amount
end

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'lib/twobook/entry.rb', line 3

def data
  @data
end

#eventObject (readonly)

Returns the value of attribute event.



3
4
5
# File 'lib/twobook/entry.rb', line 3

def event
  @event
end

#transaction_idObject (readonly)

Returns the value of attribute transaction_id.



3
4
5
# File 'lib/twobook/entry.rb', line 3

def transaction_id
  @transaction_id
end