Class: Smyte::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/smyte/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_keyObject



6
7
8
9
# File 'lib/smyte/config.rb', line 6

def api_key
  return @api_key if @api_key
  raise "Smyte api_key not set"
end

#api_secretObject



11
12
13
14
# File 'lib/smyte/config.rb', line 11

def api_secret
  return @api_secret if @api_secret
  raise "Smyte api_secret not set"
end

#loggerObject

Returns the value of attribute logger.



3
4
5
# File 'lib/smyte/config.rb', line 3

def logger
  @logger
end

#webhook_secretObject



16
17
18
19
# File 'lib/smyte/config.rb', line 16

def webhook_secret
  return @webhook_secret if @webhook_secret
  raise "Smyte webhook_secret not set"
end

Instance Method Details

#enabledObject



25
26
27
28
# File 'lib/smyte/config.rb', line 25

def enabled
  return true if @enabled.nil?
  @enabled
end

#enabled=(input) ⇒ Object



21
22
23
# File 'lib/smyte/config.rb', line 21

def enabled=input
  @enabled = !!(input.to_s =~ /^(t|1|y|ok)/)
end

#enabled?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/smyte/config.rb', line 30

def enabled?
  enabled
end