Class: Regexp::Expression::Group::Base
- Inherits:
-
Subexpression
- Object
- Base
- Subexpression
- Regexp::Expression::Group::Base
- Defined in:
- lib/regexp_parser/expression/classes/group.rb
Instance Attribute Summary
Attributes inherited from Subexpression
Attributes inherited from Base
#conditional_level, #level, #options, #quantifier, #set_level, #text, #token, #ts, #type
Instance Method Summary collapse
Methods inherited from Subexpression
#<<, #[], #all?, #clone, #each, #each_expression, #each_with_index, #empty?, #first, #initialize, #insert, #last, #length, #map, #strfregexp_tree, #te, #to_h, #traverse, #ts
Methods inherited from Base
#ascii_classes?, #case_insensitive?, #clone, #coded_offset, #default_classes?, #free_spacing?, #full_length, #greedy?, #initialize, #is?, #match, #matches?, #multiline?, #offset, #one_of?, #possessive?, #quantified?, #quantify, #quantity, #reluctant?, #starts_at, #strfregexp, #terminal?, #to_h, #to_re, #type?, #unicode_classes?
Constructor Details
This class inherits a constructor from Regexp::Expression::Subexpression
Instance Method Details
#capturing? ⇒ Boolean
5 6 7 |
# File 'lib/regexp_parser/expression/classes/group.rb', line 5 def capturing? [:capture, :named].include? @token end |
#comment? ⇒ Boolean
9 |
# File 'lib/regexp_parser/expression/classes/group.rb', line 9 def comment?; @type == :comment end |
#to_s(format = :full) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/regexp_parser/expression/classes/group.rb', line 11 def to_s(format = :full) s = '' case format when :base s << @text.dup s << @expressions.join s << ')' else s << @text.dup s << @expressions.join s << ')' s << @quantifier.to_s if quantified? end s end |