Class: TwitterCldr::Parsers::SegmentationParser::NoBreakRule
- Defined in:
- lib/twitter_cldr/parsers/segmentation_parser.rb
Instance Attribute Summary collapse
-
#regex ⇒ Object
readonly
Returns the value of attribute regex.
Attributes inherited from Rule
Instance Method Summary collapse
- #boundary_symbol ⇒ Object
-
#initialize(regex) ⇒ NoBreakRule
constructor
A new instance of NoBreakRule.
- #match(str) ⇒ Object
Constructor Details
#initialize(regex) ⇒ NoBreakRule
Returns a new instance of NoBreakRule.
53 54 55 |
# File 'lib/twitter_cldr/parsers/segmentation_parser.rb', line 53 def initialize(regex) @regex = regex end |
Instance Attribute Details
#regex ⇒ Object (readonly)
Returns the value of attribute regex.
51 52 53 |
# File 'lib/twitter_cldr/parsers/segmentation_parser.rb', line 51 def regex @regex end |
Instance Method Details
#boundary_symbol ⇒ Object
63 64 65 |
# File 'lib/twitter_cldr/parsers/segmentation_parser.rb', line 63 def boundary_symbol :no_break end |
#match(str) ⇒ Object
57 58 59 60 61 |
# File 'lib/twitter_cldr/parsers/segmentation_parser.rb', line 57 def match(str) if match = regex.match(str) RuleMatchData.new(match[0], match.offset(0).last) end end |