Class: RuboCop::Cop::Migration::RemoveColumn::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop/cop/migration/remove_column.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content:, path:, target_ruby_version:) ⇒ Parser

Returns a new instance of Parser.

Parameters:

  • content (String)
  • path (String)
  • target_ruby_version (#to_s)


202
203
204
205
206
207
208
209
210
# File 'lib/rubocop/cop/migration/remove_column.rb', line 202

def initialize(
  content:,
  path:,
  target_ruby_version:
)
  @content = content
  @path = path
  @target_ruby_version = target_ruby_version
end

Class Method Details

.call(content:, path:, target_ruby_version:) ⇒ RuboCop::AST::Node

Parameters:

  • content (String)
  • path (String)
  • target_ruby_version (#to_s)

Returns:

  • (RuboCop::AST::Node)


186
187
188
189
190
191
192
193
194
195
196
# File 'lib/rubocop/cop/migration/remove_column.rb', line 186

def call(
  content:,
  path:,
  target_ruby_version:
)
  new(
    content: content,
    path: path,
    target_ruby_version: target_ruby_version
  ).call
end

Instance Method Details

#callRuboCop::AST::Node

Returns:

  • (RuboCop::AST::Node)


213
214
215
# File 'lib/rubocop/cop/migration/remove_column.rb', line 213

def call
  parser.parse(buffer)
end