Class: Prism::Translation::Ripper::Lexer::Elem
Do not use. This class is for internal use only.
| Relationships & Source Files | |
| Inherits: | Object |
| Defined in: | lib/prism/translation/ripper/lexer.rb |
Class Method Summary
Instance Attribute Summary
Instance Method Summary
- #[](index)
- #inspect (also: #to_s)
- #pretty_print(q)
- #to_a
-
#to_s
Alias for #inspect.
Constructor Details
.new(pos, event, tok, state, message = nil) ⇒ Elem
Instance Attribute Details
#event (rw)
[ GitHub ]#message (rw)
[ GitHub ]#pos (rw)
[ GitHub ]#state (rw)
[ GitHub ]#tok (rw)
[ GitHub ]Instance Method Details
#[](index)
[ GitHub ]#inspect Also known as: #to_s
[ GitHub ]#pretty_print(q)
[ GitHub ]# File 'lib/prism/translation/ripper/lexer.rb', line 84
def pretty_print(q) q.group(2, "#<#{self.class}:", ">") { q.breakable q.text("#{event}@#{pos[0]}:#{pos[1]}") q.breakable state.pretty_print(q) q.breakable q.text("token: ") tok.pretty_print(q) if q.breakable q.text("message: ") q.text() end } end
#to_a
[ GitHub ]# File 'lib/prism/translation/ripper/lexer.rb', line 101
def to_a if @message [@pos, @event, @tok, @state, @message] else [@pos, @event, @tok, @state] end end
#to_s
Alias for #inspect.
# File 'lib/prism/translation/ripper/lexer.rb', line 82
alias to_s inspect