Class: Jsonerino::Token

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

Constant Summary collapse

TOKEN_ID =
:token_id
TOKEN_STRING =
:token_string
TOKEN_NUMBER =
:token_number
TOKEN_LCURLY =
:token_lcurly
TOKEN_RCURLY =
:token_rcurly
TOKEN_LBRACKET =
:token_lbracket
TOKEN_RBRACKET =
:token_rbracket
TOKEN_COMMA =
:token_comma
TOKEN_COLON =
:token_colon

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token, value, start, finish, line) ⇒ Token

Returns a new instance of Token.



15
16
17
18
19
20
21
# File 'lib/jsonerino/token.rb', line 15

def initialize(token, value, start, finish, line)
  @token = token
  @value = value
  @start = start
  @finish = finish
  @line = line
end

Instance Attribute Details

#finishObject (readonly)

Returns the value of attribute finish.



13
14
15
# File 'lib/jsonerino/token.rb', line 13

def finish
  @finish
end

#lineObject (readonly)

Returns the value of attribute line.



13
14
15
# File 'lib/jsonerino/token.rb', line 13

def line
  @line
end

#startObject (readonly)

Returns the value of attribute start.



13
14
15
# File 'lib/jsonerino/token.rb', line 13

def start
  @start
end

#tokenObject (readonly)

Returns the value of attribute token.



13
14
15
# File 'lib/jsonerino/token.rb', line 13

def token
  @token
end

#valueObject (readonly)

Returns the value of attribute value.



13
14
15
# File 'lib/jsonerino/token.rb', line 13

def value
  @value
end