Module: Cryptum::Event::OrderBook

Defined in:
lib/cryptum/event/order_book.rb

Class Method Summary collapse

Class Method Details

.helpObject

Display Usage for this Module



27
28
29
30
31
# File 'lib/cryptum/event/order_book.rb', line 27

public_class_method def self.help
  puts "USAGE:
    #{self}.write()
  "
end

.write(opts = {}) ⇒ Object

Supported Method Parameters

Cryptum::Event::BotConf.write( )



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/cryptum/event/order_book.rb', line 11

public_class_method def self.write(opts = {})
  terminal_win = opts[:terminal_win]
  event_history = opts[:event_history]

  terminal_win.key_press_event.key_w = false
  order_book_file = event_history.order_book[:path]

  File.write(
    order_book_file,
    JSON.pretty_generate(event_history.order_book)
  )
rescue StandardError => e
  raise e
end