Class: TkWrapper::Widgets::Base::Match

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

Overview

single ‘match’ as part of a Matches object

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, cls: nil, match: nil, widget: nil) ⇒ Match

Returns a new instance of Match.



7
8
9
10
11
12
13
# File 'lib/widgets/base/match.rb', line 7

def initialize(value, cls: nil, match: nil, widget: nil)
  @key = match&.[](0) || value
  @widget = widget
  @match = match
  @cls = cls
  @value = value
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



5
6
7
# File 'lib/widgets/base/match.rb', line 5

def key
  @key
end

#matchObject (readonly)

Returns the value of attribute match.



5
6
7
# File 'lib/widgets/base/match.rb', line 5

def match
  @match
end

#widgetObject (readonly)

Returns the value of attribute widget.



5
6
7
# File 'lib/widgets/base/match.rb', line 5

def widget
  @widget
end

Instance Method Details

#tk_widgetObject



15
16
17
# File 'lib/widgets/base/match.rb', line 15

def tk_widget
  @widget&.tk_widget
end