Class: ROM::SQL::Migration::SQLParser::Token Private

Inherits:
String
  • Object
show all
Defined in:
lib/rom/sql/migration/sql_parser.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, type:, line:, pos:) ⇒ Token

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Token.



160
161
162
163
164
165
166
167
168
# File 'lib/rom/sql/migration/sql_parser.rb', line 160

def initialize(value, type:, line:, pos:)
  super(value)

  @type = type
  @line = line
  @pos  = pos

  freeze
end

Instance Attribute Details

#line ⇒ Object (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



158
159
160
# File 'lib/rom/sql/migration/sql_parser.rb', line 158

def line
  @line
end

#pos ⇒ Object (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



158
159
160
# File 'lib/rom/sql/migration/sql_parser.rb', line 158

def pos
  @pos
end

#type ⇒ Object (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



158
159
160
# File 'lib/rom/sql/migration/sql_parser.rb', line 158

def type
  @type
end

Instance Method Details

#end ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



172
# File 'lib/rom/sql/migration/sql_parser.rb', line 172

def end = pos + length

#inspect ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



171
# File 'lib/rom/sql/migration/sql_parser.rb', line 171

def inspect = "(#{type} #{super} @#{line_pos})"

#line_pos ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



174
# File 'lib/rom/sql/migration/sql_parser.rb', line 174

def line_pos = "#{line}:#{pos}"

#type?(name) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


173
# File 'lib/rom/sql/migration/sql_parser.rb', line 173

def type?(name) = type == name

#value ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



170
# File 'lib/rom/sql/migration/sql_parser.rb', line 170

def value = to_s