Class: TkWrapper::Widgets::Base::Matcher
- Inherits:
-
Object
- Object
- TkWrapper::Widgets::Base::Matcher
- Defined in:
- lib/widgets/base/matcher.rb
Constant Summary collapse
Instance Method Summary collapse
-
#initialize(value: nil, comparator: nil) ⇒ Matcher
constructor
A new instance of Matcher.
-
#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.
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 |