Class: XRBP::NodeStore::STLedgerEntry

Inherits:
STObject
  • Object
show all
Defined in:
lib/xrbp/nodestore/sle/st_ledger_entry.rb

Overview

Special type of Serialized Object whose type is identified through the ‘ledger_entry_type’ field

Instance Attribute Summary collapse

Attributes inherited from STObject

#fields, #item

Instance Method Summary collapse

Methods inherited from STObject

#account_id, #amount, #field, #field?, #flag?, #flags

Constructor Details

#initialize(args = {}) ⇒ STLedgerEntry

Returns a new instance of STLedgerEntry.



8
9
10
11
# File 'lib/xrbp/nodestore/sle/st_ledger_entry.rb', line 8

def initialize(args={})
  super
  @key = args[:key]
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



6
7
8
# File 'lib/xrbp/nodestore/sle/st_ledger_entry.rb', line 6

def key
  @key
end

Instance Method Details

#typeObject



17
18
19
# File 'lib/xrbp/nodestore/sle/st_ledger_entry.rb', line 17

def type
  @type ||= Format::LEDGER_ENTRY_TYPE_CODES[type_code]
end

#type_codeObject



13
14
15
# File 'lib/xrbp/nodestore/sle/st_ledger_entry.rb', line 13

def type_code
  @type_code ||= field(:uint16, :ledger_entry_type)
end