Class: Newman::Settings

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSettings

Returns a new instance of Settings.



7
8
9
10
11
12
# File 'lib/newman/settings.rb', line 7

def initialize
  self.imap        = OpenStruct.new
  self.smtp        = OpenStruct.new
  self.service     = OpenStruct.new
  self.application = OpenStruct.new
end

Instance Attribute Details

#applicationObject

Returns the value of attribute application.



19
20
21
# File 'lib/newman/settings.rb', line 19

def application
  @application
end

#imapObject

Returns the value of attribute imap.



19
20
21
# File 'lib/newman/settings.rb', line 19

def imap
  @imap
end

#serviceObject

Returns the value of attribute service.



19
20
21
# File 'lib/newman/settings.rb', line 19

def service
  @service
end

#smtpObject

Returns the value of attribute smtp.



19
20
21
# File 'lib/newman/settings.rb', line 19

def smtp
  @smtp
end

Class Method Details

.from_file(filename) ⇒ Object



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

def self.from_file(filename)
  new.tap { |o| o.load_config(filename) }
end

Instance Method Details

#load_config(filename) ⇒ Object



14
15
16
# File 'lib/newman/settings.rb', line 14

def load_config(filename)
  eval(File.read(filename), binding)
end