Class: Escort::OptionDependencyValidator
- Inherits:
-
Object
- Object
- Escort::OptionDependencyValidator
- Defined in:
- lib/escort/option_dependency_validator.rb
Instance Attribute Summary collapse
-
#parser ⇒ Object
readonly
Returns the value of attribute parser.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(parser) ⇒ OptionDependencyValidator
constructor
A new instance of OptionDependencyValidator.
- #validate(options, dependencies) ⇒ Object
Constructor Details
#initialize(parser) ⇒ OptionDependencyValidator
Returns a new instance of OptionDependencyValidator.
11 12 13 |
# File 'lib/escort/option_dependency_validator.rb', line 11 def initialize(parser) @parser = parser end |
Instance Attribute Details
#parser ⇒ Object (readonly)
Returns the value of attribute parser.
9 10 11 |
# File 'lib/escort/option_dependency_validator.rb', line 9 def parser @parser end |
Class Method Details
.for(parser) ⇒ Object
4 5 6 |
# File 'lib/escort/option_dependency_validator.rb', line 4 def for(parser) self.new(parser) end |
Instance Method Details
#validate(options, dependencies) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/escort/option_dependency_validator.rb', line 15 def validate(, dependencies) dependencies.each_pair do |option_name, dependency_rules| ensure_dependencies_satisfied_for(option_name, dependency_rules, ) end end |