Class: Newman::Settings
- Inherits:
-
Object
- Object
- Newman::Settings
- Defined in:
- lib/newman/settings.rb
Instance Attribute Summary collapse
-
#application ⇒ Object
Returns the value of attribute application.
-
#imap ⇒ Object
Returns the value of attribute imap.
-
#service ⇒ Object
Returns the value of attribute service.
-
#smtp ⇒ Object
Returns the value of attribute smtp.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Settings
constructor
A new instance of Settings.
- #load_config(filename) ⇒ Object
Constructor Details
#initialize ⇒ Settings
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
#application ⇒ Object
Returns the value of attribute application.
19 20 21 |
# File 'lib/newman/settings.rb', line 19 def application @application end |
#imap ⇒ Object
Returns the value of attribute imap.
19 20 21 |
# File 'lib/newman/settings.rb', line 19 def imap @imap end |
#service ⇒ Object
Returns the value of attribute service.
19 20 21 |
# File 'lib/newman/settings.rb', line 19 def service @service end |
#smtp ⇒ Object
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 |