Sha256: 336d847b24942822769483fbfcb1930ae506e93433749ceffa002ed5d4c45798

Contents?: true

Size: 856 Bytes

Versions: 104

Compression:

Stored size: 856 Bytes

Contents

# frozen_string_literal: true

module Cryptum
  # This plugin is used to Write the Order Book from Memory
  # to File When the "w" Key is Pressed
  module Event
    module OrderBook
      # Supported Method Parameters::
      # Cryptum::Event::BotConf.write(
      # )
      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

      # Display Usage for this Module
      public_class_method def self.help
        puts "USAGE:
          #{self}.write()
        "
      end
    end
  end
end

Version data entries

104 entries across 104 versions & 1 rubygems

Version Path
cryptum-0.0.383 lib/cryptum/event/order_book.rb
cryptum-0.0.382 lib/cryptum/event/order_book.rb
cryptum-0.0.381 lib/cryptum/event/order_book.rb
cryptum-0.0.380 lib/cryptum/event/order_book.rb
cryptum-0.0.379 lib/cryptum/event/order_book.rb
cryptum-0.0.378 lib/cryptum/event/order_book.rb
cryptum-0.0.377 lib/cryptum/event/order_book.rb
cryptum-0.0.376 lib/cryptum/event/order_book.rb
cryptum-0.0.375 lib/cryptum/event/order_book.rb
cryptum-0.0.374 lib/cryptum/event/order_book.rb
cryptum-0.0.373 lib/cryptum/event/order_book.rb
cryptum-0.0.372 lib/cryptum/event/order_book.rb
cryptum-0.0.370 lib/cryptum/event/order_book.rb
cryptum-0.0.369 lib/cryptum/event/order_book.rb
cryptum-0.0.368 lib/cryptum/event/order_book.rb
cryptum-0.0.367 lib/cryptum/event/order_book.rb
cryptum-0.0.366 lib/cryptum/event/order_book.rb
cryptum-0.0.365 lib/cryptum/event/order_book.rb
cryptum-0.0.364 lib/cryptum/event/order_book.rb
cryptum-0.0.363 lib/cryptum/event/order_book.rb