Class: Regexp::Token
- Inherits:
-
Struct
- Object
- Struct
- Regexp::Token
- Defined in:
- lib/regexp_parser/token.rb
Instance Attribute Summary collapse
-
#next ⇒ Object
Returns the value of attribute next.
-
#previous ⇒ Object
Returns the value of attribute previous.
Instance Method Summary collapse
Instance Attribute Details
#next ⇒ Object
Returns the value of attribute next.
15 16 17 |
# File 'lib/regexp_parser/token.rb', line 15 def next @next end |
#previous ⇒ Object
Returns the value of attribute previous.
15 16 17 |
# File 'lib/regexp_parser/token.rb', line 15 def previous @previous end |
Instance Method Details
#length ⇒ Object
21 22 23 |
# File 'lib/regexp_parser/token.rb', line 21 def length te - ts end |
#offset ⇒ Object
17 18 19 |
# File 'lib/regexp_parser/token.rb', line 17 def offset [ts, te] end |
#to_h ⇒ Object
26 27 28 29 30 31 |
# File 'lib/regexp_parser/token.rb', line 26 def to_h members.inject({}) do |hash, member| hash[member.to_sym] = self[member] hash end end |