settings.rb |
|
---|---|
Unless you need to customize the way that Newman’s configuration system
works or make changes to your settings objects at runtime, you probably don’t
need to worry about how this object is implemented. Both
The following settings are currently supported:
|
module Newman
class Settings |
|
|
The
This method is purely syntactic sugar, and is functionally equivalent to the following code:
Because there currently is little advantage to explicitly instantiating a
blank |
def self.from_file(filename)
new.tap { |o| o.load_config(filename) }
end |
|
|
A In most situations, you will not instantiate a We are aware of the fact that the current configuration system is way too flexible and a breeding ground for subtle bugs. This will be fixed in a future version of Newman. |
def initialize
self.imap = OpenStruct.new
self.smtp = OpenStruct.new
self.service = OpenStruct.new
self.application = OpenStruct.new
end |
|
|
The |
attr_accessor :imap, :smtp, :service, :application |
|
|
In practice, this method is typically called by
|
def load_config(filename)
eval(File.read(filename), binding)
end
end
end |