Sha256: f9649301e37b70d8c039f390aef0df14fe1fb541048eb51335f3da24b7b09307

Contents?: true

Size: 497 Bytes

Versions: 2

Compression:

Stored size: 497 Bytes

Contents

# frozen_string_literal: true

module FtxExchangeApi
  class Config
    attr_accessor :timeout
    attr_accessor :logger

    def initialize(data = nil)
      data ||= {}
      @timeout = data[:timeout]
      @logger = data[:logger]
    end

    def reverse_merge!(other)
      @timeout ||= other.timeout
      @logger ||= other.logger
    end
  end

  @default_config = Config.new
  @default_config.timeout = 3

  class << self
    attr_reader :default_config
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ftx_exchange_api-0.0.2 lib/ftx_exchange_api/config.rb
ftx_exchange_api-0.0.1 lib/ftx_exchange_api/config.rb