Module: Elasticord::Config

Defined in:
lib/elasticord/config.rb

Class Method Summary collapse

Class Method Details

.dataObject



19
20
21
# File 'lib/elasticord/config.rb', line 19

def data
  @data ||= {}
end

.get(key) ⇒ Object



9
10
11
12
13
# File 'lib/elasticord/config.rb', line 9

def get(key)
  return data[key] if data.key?(key)

  ENV.fetch(key.to_s.upcase, ENV.fetch("ELASTICORD_#{key.to_s.upcase}"))
end

.prefix(value) ⇒ Object



15
16
17
# File 'lib/elasticord/config.rb', line 15

def prefix(value)
  @prefix = value
end

.set(key, value) ⇒ Object



5
6
7
# File 'lib/elasticord/config.rb', line 5

def set(key, value)
  data[key] = value
end