Class: XRBP::WebSocket::Cmds::BookOffers
- Inherits:
-
XRBP::WebSocket::Command
- Object
- Message
- XRBP::WebSocket::Command
- XRBP::WebSocket::Cmds::BookOffers
- Defined in:
- lib/xrbp/websocket/cmds/book_offers.rb
Overview
The book_offers method retrieves a list of offers, also known as the order book , between two currencies
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
Attributes inherited from XRBP::WebSocket::Command
Attributes inherited from Message
#bl, #connection, #result, #time
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ BookOffers
constructor
A new instance of BookOffers.
- #page_title ⇒ Object
- #sanitized_args ⇒ Object
- #to_h ⇒ Object
Methods inherited from XRBP::WebSocket::Command
Methods inherited from Message
Constructor Details
#initialize(args = {}) ⇒ BookOffers
Returns a new instance of BookOffers.
17 18 19 20 21 |
# File 'lib/xrbp/websocket/cmds/book_offers.rb', line 17 def initialize(args={}) @args = args parse_paginate(args) super(to_h) end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
15 16 17 |
# File 'lib/xrbp/websocket/cmds/book_offers.rb', line 15 def args @args end |
Class Method Details
.from_h(h) ⇒ Object
23 24 25 |
# File 'lib/xrbp/websocket/cmds/book_offers.rb', line 23 def self.from_h(h) new Hash[h] end |
Instance Method Details
#page_title ⇒ Object
11 12 13 |
# File 'lib/xrbp/websocket/cmds/book_offers.rb', line 11 def page_title "offers" end |
#sanitized_args ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/xrbp/websocket/cmds/book_offers.rb', line 27 def sanitized_args sa = Hash[args_without_paginate] sa[:taker_gets].delete(:issuer) if sa[:taker_gets][:currency] == "XRP" sa[:taker_pays].delete(:issuer) if sa[:taker_pays][:currency] == "XRP" sa end |
#to_h ⇒ Object
36 37 38 |
# File 'lib/xrbp/websocket/cmds/book_offers.rb', line 36 def to_h sanitized_args.merge(:command => :book_offers) end |