Class: Frontman::Config

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/frontman/config.rb

Class Method Summary collapse

Class Method Details

.allObject



46
47
48
49
# File 'lib/frontman/config.rb', line 46

def all
  @@values ||= {}
  @@values
end

.delete(key) ⇒ Object



33
34
35
36
37
# File 'lib/frontman/config.rb', line 33

def delete(key)
  @@values ||= {}
  @@values.delete(key)
  self
end

.get(key, fallback: nil) ⇒ Object



27
28
29
30
# File 'lib/frontman/config.rb', line 27

def get(key, fallback: nil)
  @@values ||= {}
  @@values.key?(key.to_sym) ? @@values[key.to_sym] : fallback
end

.has?(key) ⇒ Boolean

Returns:

  • (Boolean)


40
41
42
43
# File 'lib/frontman/config.rb', line 40

def has?(key)
  @@values ||= {}
  @@values.key?(key.to_sym)
end

.set(key, value) ⇒ Object



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

def set(key, value)
  @@values ||= {}
  @@values[key.to_sym] = value
  self
end