Class: TkWrapper::Widgets::Base::Matcher

Inherits:
Object
  • Object
show all
Defined in:
lib/widgets/base/matcher.rb

Constant Summary collapse

Match =
TkWrapper::Widgets::Base::Match

Instance Method Summary collapse

Constructor Details

#initialize(value: nil, comparator: nil) ⇒ Matcher

Returns a new instance of Matcher.



8
9
10
# File 'lib/widgets/base/matcher.rb', line 8

def initialize(value: nil, comparator: nil)
  @match_function = curry_match_function(value, comparator)
end

Instance Method Details

#match(*args) ⇒ Object

args:

[]                if widget and matcher were provided on initialization
[widget]          if matcher was provided on initialization
[matcher]         if widget was provided on initialization
[widget, matcher] if neither widget nor matcher were provided on initial.


17
18
19
# File 'lib/widgets/base/matcher.rb', line 17

def match(*args)
  @match_function.call(*args)
end