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.
-
#id ⇒ Object
Returns the value of attribute id.
Attributes inherited from XRBP::WebSocket::Command
Attributes inherited from Message
#bl, #connection, #result, #time
Instance Method Summary collapse
- #id? ⇒ Boolean
-
#initialize(id = nil, args = {}) ⇒ Ledger
constructor
A new instance of Ledger.
- #to_h ⇒ Object
Methods inherited from XRBP::WebSocket::Command
Methods inherited from Message
Constructor Details
#initialize(id = 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(id=nil, args={}) @id = id @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 |
#id ⇒ Object
Returns the value of attribute id.
8 9 10 |
# File 'lib/xrbp/websocket/cmds/ledger.rb', line 8 def id @id end |
Instance Method Details
#id? ⇒ Boolean
16 17 18 |
# File 'lib/xrbp/websocket/cmds/ledger.rb', line 16 def id? !!id 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'] = id if id? return h end |