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, #ident, #offset, #tag
Instance Method Summary collapse
-
#initialize(ident, offset = nil, starter = ':') ⇒ SymbolToken
constructor
A new instance of SymbolToken.
- #to_s ⇒ Object
Methods inherited from Token
#error, #has_no_block?, #ws_munge
Constructor Details
#initialize(ident, offset = nil, starter = ':') ⇒ SymbolToken
Returns a new instance of SymbolToken.
160 161 162 163 164 165 166 167 168 169 |
# File 'lib/rubylexer/token.rb', line 160 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.
158 159 160 |
# File 'lib/rubylexer/token.rb', line 158 def close @close end |
#open ⇒ Object
Returns the value of attribute open.
158 159 160 |
# File 'lib/rubylexer/token.rb', line 158 def open @open end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
159 160 161 |
# File 'lib/rubylexer/token.rb', line 159 def raw @raw end |
Instance Method Details
#to_s ⇒ Object
171 172 173 174 175 176 177 178 |
# File 'lib/rubylexer/token.rb', line 171 def to_s return @ident =begin [email protected]_s raw=raw[1...-1] if StringToken===@raw @open+raw+@close =end end |