Class: HexTokenBot::Bots::Base
- Inherits:
-
Object
- Object
- HexTokenBot::Bots::Base
show all
- Includes:
- Info
- Defined in:
- lib/hex_token_bot/bots/base.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Info
#debug, #error, #info, #logger_set!, #warn
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
35
36
37
|
# File 'lib/hex_token_bot/bots/base.rb', line 35
def initialize
logger_set! debug?
end
|
Class Method Details
.run! ⇒ Object
31
32
33
|
# File 'lib/hex_token_bot/bots/base.rb', line 31
def self.run!
self.new.run
end
|
.set(key, value) ⇒ Object
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/hex_token_bot/bots/base.rb', line 44
def set(key, value)
keys = [:name, :debug?, :channels, :markets]
if keys.include? key
self.instance_eval do
define_method key, lambda { value }
private key
end
else
raise NotImplementedError, "This option is not support, #{key}, #{value}"
end
end
|
.set!(key, value) ⇒ Object
56
57
58
59
60
61
62
63
|
# File 'lib/hex_token_bot/bots/base.rb', line 56
def set!(key, value)
keys = [:run?]
if keys.include? key
define_singleton_method key, value
else
raise NotImplementedError, "This option is not support, #{key}, #{value}"
end
end
|
Instance Method Details
#debug? ⇒ Boolean
39
40
41
|
# File 'lib/hex_token_bot/bots/base.rb', line 39
def debug?
nil
end
|