Class: Ruby2JS::Token
- Inherits:
-
String
- Object
- String
- Ruby2JS::Token
- Defined in:
- lib/ruby2js/serializer.rb
Instance Attribute Summary collapse
-
#ast ⇒ Object
Returns the value of attribute ast.
-
#loc ⇒ Object
Returns the value of attribute loc.
Instance Method Summary collapse
-
#initialize(string, ast) ⇒ Token
constructor
A new instance of Token.
Constructor Details
#initialize(string, ast) ⇒ Token
Returns a new instance of Token.
6 7 8 9 10 |
# File 'lib/ruby2js/serializer.rb', line 6 def initialize(string, ast) super(string.to_s) @ast = ast @loc = ast.location if ast end |
Instance Attribute Details
#ast ⇒ Object
Returns the value of attribute ast.
4 5 6 |
# File 'lib/ruby2js/serializer.rb', line 4 def ast @ast end |
#loc ⇒ Object
Returns the value of attribute loc.
3 4 5 |
# File 'lib/ruby2js/serializer.rb', line 3 def loc @loc end |