Class: HammerCLI::Options::Matcher

Inherits:
Object
  • Object
show all
Defined in:
lib/hammer_cli/options/matcher.rb

Instance Method Summary collapse

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

Returns:

  • (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