Class: Schnitzelpress::Config

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
lib/schnitzelpress/config.rb

Class Method Summary collapse

Class Method Details

.forget_instanceObject



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

def forget_instance
  @@instance = nil
end

.get(k) ⇒ Object



34
35
36
# File 'lib/schnitzelpress/config.rb', line 34

def get(k)
  instance.send(k)
end

.instanceObject



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

def instance
  @@instance ||= find_or_create_by(:id => 'schnitzelpress')
end

.set(k, v) ⇒ Object



38
39
40
41
# File 'lib/schnitzelpress/config.rb', line 38

def set(k, v)
  instance.update_attributes!(k => v)
  v
end