Class: FixtureFox::AnchorToken

Inherits:
Token
  • Object
show all
Defined in:
lib/fixture_fox/token.rb

Instance Attribute Summary

Attributes inherited from Token

#file, #initial_indent, #lineno, #litt, #pos, #value

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Token

#==, #error, #to_s

Constructor Details

#initialize(file, lineno, initial_indent, pos, litt) ⇒ AnchorToken

Returns a new instance of AnchorToken.



24
25
26
27
# File 'lib/fixture_fox/token.rb', line 24

def initialize(file, lineno, initial_indent, pos, litt)
  super
  @value = litt[1..-1].to_sym
end

Class Method Details

.of_ident(ident) ⇒ Object

Convert an Ident token to a AnchorToken token



30
31
32
# File 'lib/fixture_fox/token.rb', line 30

def self.of_ident(ident)
  AnchorToken.new(ident.file, ident.lineno, ident.initial_indent, ident.pos, "&#{ident.litt}")
end