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

#_type ⇒ Object

Returns the value of attribute _type.



41
42
43
# File 'lib/anbt-sql-formatter/token.rb', line 41

def _type
  @_type
end

#pos ⇒ Object

Returns the value of attribute pos.



41
42
43
# File 'lib/anbt-sql-formatter/token.rb', line 41

def pos
  @pos
end

#string ⇒ Object

Returns the value of attribute string.



41
42
43
# File 'lib/anbt-sql-formatter/token.rb', line 41

def string
  @string
end

Instance Method Details

#to_s ⇒ Object

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

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

@return

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



56
57
58
# File 'lib/anbt-sql-formatter/token.rb', line 56

def to_s
  @string
end