Class: BitexBot::SettingsClass

Inherits:
Hashie::Mash
  • Object
show all
Includes:
Hashie::Extensions::Mash::SymbolizeKeys
Defined in:
lib/bitex_bot/settings.rb

Overview

This class load settings file, else write a sample file.

Instance Method Summary collapse

Instance Method Details

#baseObject



42
43
44
# File 'lib/bitex_bot/settings.rb', line 42

def base
  order_book_currencies[:base]
end

#buying_fx_rateObject



34
35
36
# File 'lib/bitex_bot/settings.rb', line 34

def buying_fx_rate
  Store.first.try(:buying_fx_rate) || buying_foreign_exchange_rate
end

#load_defaultObject



28
29
30
31
32
# File 'lib/bitex_bot/settings.rb', line 28

def load_default
  path = ARGV[0] || 'bitex_bot_settings.rb'
  show_sample(path) unless FileTest.exists?(path)
  load_settings(path)
end

#load_testObject



24
25
26
# File 'lib/bitex_bot/settings.rb', line 24

def load_test
  load_settings(sample_path)
end

#maker_classObject



50
51
52
# File 'lib/bitex_bot/settings.rb', line 50

def maker_class
  exchange_class(maker)
end

#maker_settingsObject



58
59
60
# File 'lib/bitex_bot/settings.rb', line 58

def maker_settings
  exchange_settings(maker)
end

#quoteObject



46
47
48
# File 'lib/bitex_bot/settings.rb', line 46

def quote
  order_book_currencies[:quote]
end

#selling_fx_rateObject



38
39
40
# File 'lib/bitex_bot/settings.rb', line 38

def selling_fx_rate
  Store.first.try(:selling_fx_rate) || selling_foreign_exchange_rate
end

#taker_classObject



54
55
56
# File 'lib/bitex_bot/settings.rb', line 54

def taker_class
  exchange_class(taker)
end

#taker_settingsObject



62
63
64
# File 'lib/bitex_bot/settings.rb', line 62

def taker_settings
  exchange_settings(taker)
end