Method: YARD::Parser::Ruby::Legacy::TokenList#push
- Defined in:
- lib/yard/parser/ruby/legacy/token_list.rb
permalink #push(*tokens) ⇒ Object Also known as: <<
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/yard/parser/ruby/legacy/token_list.rb', line 25 def push(*tokens) tokens.each do |tok| if tok.is_a?(TokenList) || tok.is_a?(Array) concat tok elsif tok.is_a?(Token) super tok elsif tok.is_a?(String) parse_content(tok) else raise ArgumentError, "Expecting token, list of tokens or string of code to be tokenized. Got #{tok.class}" end end self end |