Class: Wary::SuiteBuilder
- Inherits:
-
Object
- Object
- Wary::SuiteBuilder
- Defined in:
- lib/wary/suite_builder.rb
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(configuration) ⇒ SuiteBuilder
constructor
A new instance of SuiteBuilder.
Constructor Details
#initialize(configuration) ⇒ SuiteBuilder
Returns a new instance of SuiteBuilder.
5 6 7 |
# File 'lib/wary/suite_builder.rb', line 5 def initialize(configuration) @checks = configuration.fetch(:checks) || [] end |
Instance Method Details
#build ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/wary/suite_builder.rb', line 9 def build initialized_checks = @checks.map do |name, config| klass = config.fetch(:class) config[:name] = name constantize("Wary::Check::#{klass}").new(config) end Wary::CheckSuite.new(initialized_checks) end |