Class: Inquisitor::Settings

Inherits:
Object
  • Object
show all
Defined in:
lib/inquisitor/settings.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSettings

Returns a new instance of Settings.



5
6
7
8
9
# File 'lib/inquisitor/settings.rb', line 5

def initialize
  self.mail_from = '[email protected]'
  self.mail_subject = 'Subject for Inquisitor notify letter'
  self.check_period = 30
end

Instance Attribute Details

#check_periodObject

Returns the value of attribute check_period.



3
4
5
# File 'lib/inquisitor/settings.rb', line 3

def check_period
  @check_period
end

#mail_fromObject

Returns the value of attribute mail_from.



3
4
5
# File 'lib/inquisitor/settings.rb', line 3

def mail_from
  @mail_from
end

#mail_subjectObject

Returns the value of attribute mail_subject.



3
4
5
# File 'lib/inquisitor/settings.rb', line 3

def mail_subject
  @mail_subject
end

Instance Method Details

#db_path=(path) ⇒ Object



11
12
13
14
# File 'lib/inquisitor/settings.rb', line 11

def db_path=(path)
  DataMapper.setup(:default, path)
  DataMapper.auto_upgrade!
end

#set(params) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/inquisitor/settings.rb', line 16

def set(params)
  params.each do |key, value|
    if respond_to?("#{key}=")
      send("#{key}=", value)
    end
  end
end