Class: Promptmenot::Match
- Inherits:
-
Object
- Object
- Promptmenot::Match
- Defined in:
- lib/promptmenot/match.rb
Instance Attribute Summary collapse
-
#matched_text ⇒ Object
readonly
Returns the value of attribute matched_text.
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #category ⇒ Object
- #confidence ⇒ Object
-
#initialize(pattern:, matched_text:, position:) ⇒ Match
constructor
A new instance of Match.
- #pattern_name ⇒ Object
- #sensitivity ⇒ Object
Constructor Details
#initialize(pattern:, matched_text:, position:) ⇒ Match
Returns a new instance of Match.
7 8 9 10 11 |
# File 'lib/promptmenot/match.rb', line 7 def initialize(pattern:, matched_text:, position:) @pattern = pattern @matched_text = matched_text @position = position end |
Instance Attribute Details
#matched_text ⇒ Object (readonly)
Returns the value of attribute matched_text.
5 6 7 |
# File 'lib/promptmenot/match.rb', line 5 def matched_text @matched_text end |
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
5 6 7 |
# File 'lib/promptmenot/match.rb', line 5 def pattern @pattern end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
5 6 7 |
# File 'lib/promptmenot/match.rb', line 5 def position @position end |
Instance Method Details
#==(other) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/promptmenot/match.rb', line 29 def ==(other) other.is_a?(Match) && pattern_name == other.pattern_name && matched_text == other.matched_text && position == other.position end |
#category ⇒ Object
13 14 15 |
# File 'lib/promptmenot/match.rb', line 13 def category pattern.category end |
#confidence ⇒ Object
21 22 23 |
# File 'lib/promptmenot/match.rb', line 21 def confidence pattern.confidence end |
#pattern_name ⇒ Object
17 18 19 |
# File 'lib/promptmenot/match.rb', line 17 def pattern_name pattern.name end |
#sensitivity ⇒ Object
25 26 27 |
# File 'lib/promptmenot/match.rb', line 25 def sensitivity pattern.sensitivity end |