Class: Aserto::Config
- Inherits:
-
Object
- Object
- Aserto::Config
- Defined in:
- lib/aserto/config.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(options) ⇒ Config
Returns a new instance of Config.
57 58 59 60 61 |
# File 'lib/aserto/config.rb', line 57 def initialize() OPTIONS.each do |key| send(:"#{key}=", [key] || DEFAULT_ATTRS[key]) end end |
Class Method Details
.default_logger ⇒ Object
8 9 10 11 12 |
# File 'lib/aserto/config.rb', line 8 def default_logger logger = Logger.new($stdout) logger.progname = "aserto" logger end |
.validate! ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/aserto/config.rb', line 14 def validate! = "" REQUIRED_OPTIONS.each do |option| if !instance_variable_defined?(:"@#{option}") || instance_variable_get(:"@#{option}") == "" += "Missing required option: #{option}\n" end end raise if != "" end |