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.317 lib/cryptum/event/order_book.rb
cryptum-0.0.316 lib/cryptum/event/order_book.rb
cryptum-0.0.315 lib/cryptum/event/order_book.rb
cryptum-0.0.314 lib/cryptum/event/order_book.rb
cryptum-0.0.313 lib/cryptum/event/order_book.rb
cryptum-0.0.312 lib/cryptum/event/order_book.rb
cryptum-0.0.311 lib/cryptum/event/order_book.rb
cryptum-0.0.310 lib/cryptum/event/order_book.rb
cryptum-0.0.309 lib/cryptum/event/order_book.rb
cryptum-0.0.308 lib/cryptum/event/order_book.rb
cryptum-0.0.307 lib/cryptum/event/order_book.rb
cryptum-0.0.306 lib/cryptum/event/order_book.rb
cryptum-0.0.305 lib/cryptum/event/order_book.rb
cryptum-0.0.304 lib/cryptum/event/order_book.rb
cryptum-0.0.303 lib/cryptum/event/order_book.rb
cryptum-0.0.302 lib/cryptum/event/order_book.rb
cryptum-0.0.301 lib/cryptum/event/order_book.rb
cryptum-0.0.300 lib/cryptum/event/order_book.rb
cryptum-0.0.299 lib/cryptum/event/order_book.rb
cryptum-0.0.298 lib/cryptum/event/order_book.rb