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



40
41
42
# File 'lib/bitex_bot/settings.rb', line 40

def base
  order_book_currencies[:base]
end

#buying_fx_rateObject



32
33
34
# File 'lib/bitex_bot/settings.rb', line 32

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

#load_defaultObject



26
27
28
29
30
# File 'lib/bitex_bot/settings.rb', line 26

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

#load_testObject



22
23
24
# File 'lib/bitex_bot/settings.rb', line 22

def load_test
  load_settings(sample_path)
end

#maker_classObject



48
49
50
# File 'lib/bitex_bot/settings.rb', line 48

def maker_class
  exchange_class(maker)
end

#maker_settingsObject



56
57
58
# File 'lib/bitex_bot/settings.rb', line 56

def maker_settings
  exchange_settings(maker)
end

#quoteObject



44
45
46
# File 'lib/bitex_bot/settings.rb', line 44

def quote
  order_book_currencies[:quote]
end

#selling_fx_rateObject



36
37
38
# File 'lib/bitex_bot/settings.rb', line 36

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

#taker_classObject



52
53
54
# File 'lib/bitex_bot/settings.rb', line 52

def taker_class
  exchange_class(taker)
end

#taker_settingsObject



60
61
62
# File 'lib/bitex_bot/settings.rb', line 60

def taker_settings
  exchange_settings(taker)
end