Class: XRBP::WebSocket::Cmds::Ledger
- Inherits:
-
XRBP::WebSocket::Command
- Object
- Message
- XRBP::WebSocket::Command
- XRBP::WebSocket::Cmds::Ledger
- Defined in:
- lib/xrbp/websocket/cmds/ledger.rb
Overview
Retrieve information about the public ledger
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#ledger_index ⇒ Object
Returns the value of attribute ledger_index.
Attributes inherited from XRBP::WebSocket::Command
Attributes inherited from Message
#bl, #connection, #result, #time
Instance Method Summary collapse
-
#initialize(ledger_index = nil, args = {}) ⇒ Ledger
constructor
A new instance of Ledger.
- #ledger_index? ⇒ Boolean
- #to_h ⇒ Object
Methods inherited from XRBP::WebSocket::Command
Methods inherited from Message
Constructor Details
#initialize(ledger_index = nil, args = {}) ⇒ Ledger
Returns a new instance of Ledger.
10 11 12 13 14 |
# File 'lib/xrbp/websocket/cmds/ledger.rb', line 10 def initialize(ledger_index=nil, args={}) @ledger_index = ledger_index @args = args super(to_h) end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
8 9 10 |
# File 'lib/xrbp/websocket/cmds/ledger.rb', line 8 def args @args end |
#ledger_index ⇒ Object
Returns the value of attribute ledger_index.
8 9 10 |
# File 'lib/xrbp/websocket/cmds/ledger.rb', line 8 def ledger_index @ledger_index end |
Instance Method Details
#ledger_index? ⇒ Boolean
16 17 18 |
# File 'lib/xrbp/websocket/cmds/ledger.rb', line 16 def ledger_index? !!ledger_index end |
#to_h ⇒ Object
20 21 22 23 24 |
# File 'lib/xrbp/websocket/cmds/ledger.rb', line 20 def to_h h = args.merge(:command => :ledger) h['ledger_index'] = ledger_index if ledger_index? return h end |