Class: HammerCLI::Options::Matcher
- Inherits:
-
Object
- Object
- HammerCLI::Options::Matcher
- Defined in:
- lib/hammer_cli/options/matcher.rb
Instance Method Summary collapse
-
#initialize(filter) ⇒ Matcher
constructor
A new instance of Matcher.
- #matches?(option) ⇒ Boolean
Constructor Details
#initialize(filter) ⇒ Matcher
Returns a new instance of Matcher.
7 8 9 |
# File 'lib/hammer_cli/options/matcher.rb', line 7 def initialize(filter) @filter = filter end |
Instance Method Details
#matches?(option) ⇒ Boolean
11 12 13 14 15 16 |
# File 'lib/hammer_cli/options/matcher.rb', line 11 def matches?(option) @filter.each do |attribute, filter| return false if !attribute_matches?(option, attribute, filter) end return true end |