Class: AnbtSql::AbstractToken

Inherits:
Object
  • Object
show all
Defined in:
lib/anbt-sql-formatter/token.rb

Overview

_type

type of token

string

string of token

pos

ソース文字列の先頭からのトークンの位置をあらわす。値は ゼロ(ZERO)オリジン。デフォルト値 -1 の場合には「位置情報に意味がない」ことをあらわす。

Direct Known Subclasses

Token

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#_typeObject

Returns the value of attribute _type.



39
40
41
# File 'lib/anbt-sql-formatter/token.rb', line 39

def _type
  @_type
end

#posObject

Returns the value of attribute pos.



39
40
41
# File 'lib/anbt-sql-formatter/token.rb', line 39

def pos
  @pos
end

#stringObject

Returns the value of attribute string.



39
40
41
# File 'lib/anbt-sql-formatter/token.rb', line 39

def string
  @string
end

Instance Method Details

#to_sObject

このバリューオブジェクトの文字列表現を取得する。

オブジェクトのシャロー範囲でしか to_s されない点に注意。

@return

バリューオブジェクトの文字列表現。



54
55
56
# File 'lib/anbt-sql-formatter/token.rb', line 54

def to_s
  @string
end