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.297 lib/cryptum/event/order_book.rb
cryptum-0.0.296 lib/cryptum/event/order_book.rb
cryptum-0.0.295 lib/cryptum/event/order_book.rb
cryptum-0.0.294 lib/cryptum/event/order_book.rb
cryptum-0.0.293 lib/cryptum/event/order_book.rb
cryptum-0.0.291 lib/cryptum/event/order_book.rb
cryptum-0.0.290 lib/cryptum/event/order_book.rb
cryptum-0.0.289 lib/cryptum/event/order_book.rb
cryptum-0.0.288 lib/cryptum/event/order_book.rb
cryptum-0.0.287 lib/cryptum/event/order_book.rb
cryptum-0.0.286 lib/cryptum/event/order_book.rb
cryptum-0.0.285 lib/cryptum/event/order_book.rb
cryptum-0.0.284 lib/cryptum/event/order_book.rb
cryptum-0.0.283 lib/cryptum/event/order_book.rb
cryptum-0.0.282 lib/cryptum/event/order_book.rb
cryptum-0.0.281 lib/cryptum/event/order_book.rb
cryptum-0.0.280 lib/cryptum/event/order_book.rb
cryptum-0.0.278 lib/cryptum/event/order_book.rb
cryptum-0.0.277 lib/cryptum/event/order_book.rb
cryptum-0.0.276 lib/cryptum/event/order_book.rb