Class: RubyLexer::SymbolToken
Overview
Instance Attribute Summary collapse
-
#close ⇒ Object
Returns the value of attribute close.
-
#open ⇒ Object
Returns the value of attribute open.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Attributes inherited from Token
#allow_ooo_offset, #as, #endline, #ident, #offset, #startline, #tag
Instance Method Summary collapse
-
#initialize(ident, offset = nil, starter = ':') ⇒ SymbolToken
constructor
A new instance of SymbolToken.
- #to_s ⇒ Object
Methods inherited from Token
#dump, #error, #has_no_block?, #inspect, #linecount, #orig_inspect, #ws_munge
Constructor Details
#initialize(ident, offset = nil, starter = ':') ⇒ SymbolToken
Returns a new instance of SymbolToken.
213 214 215 216 217 218 219 220 221 222 |
# File 'lib/rubylexer/token.rb', line 213 def initialize(ident,offset=nil,starter=':') @raw=ident str=ident.to_s str[0,2]='' if /\A%s/===str super starter+str, offset @open=":" @close="" # @char=':' end |
Instance Attribute Details
#close ⇒ Object
Returns the value of attribute close.
211 212 213 |
# File 'lib/rubylexer/token.rb', line 211 def close @close end |
#open ⇒ Object
Returns the value of attribute open.
211 212 213 |
# File 'lib/rubylexer/token.rb', line 211 def open @open end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
212 213 214 |
# File 'lib/rubylexer/token.rb', line 212 def raw @raw end |
Instance Method Details
#to_s ⇒ Object
224 225 226 227 228 229 230 231 |
# File 'lib/rubylexer/token.rb', line 224 def to_s return @ident =begin [email protected]_s raw=raw[1...-1] if StringToken===@raw @open+raw+@close =end end |