Class: Twobook::Entry
- Inherits:
-
Object
- Object
- Twobook::Entry
- Defined in:
- lib/twobook/entry.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
Returns the value of attribute account.
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#transaction_id ⇒ Object
readonly
Returns the value of attribute transaction_id.
Instance Method Summary collapse
-
#initialize(amount, event, transaction_id: nil, data: {}) ⇒ Entry
constructor
A new instance of Entry.
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
#account ⇒ Object (readonly)
Returns the value of attribute account.
3 4 5 |
# File 'lib/twobook/entry.rb', line 3 def account @account end |
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
3 4 5 |
# File 'lib/twobook/entry.rb', line 3 def amount @amount end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/twobook/entry.rb', line 3 def data @data end |
#event ⇒ Object (readonly)
Returns the value of attribute event.
3 4 5 |
# File 'lib/twobook/entry.rb', line 3 def event @event end |
#transaction_id ⇒ Object (readonly)
Returns the value of attribute transaction_id.
3 4 5 |
# File 'lib/twobook/entry.rb', line 3 def transaction_id @transaction_id end |