Class: RuboCop::Cop::Lint::NoGrapeAPI

Inherits:
RuboCop::Cop show all
Defined in:
lib/rubocop/cop/lint/no_grape_api.rb

Overview

Examples:

# bad
class Foo < Grape::API

# good
class Foo < Api::AuthBase

# good
class Foo < Api::Base

Constant Summary collapse

MSG =
"Prefer inheriting `Api::AuthBase` or `Api::Base` instead of `Grape::API`."

Instance Method Summary collapse

Instance Method Details

#on_class(node) ⇒ Object



20
21
22
23
24
# File 'lib/rubocop/cop/lint/no_grape_api.rb', line 20

def on_class(node)
  return unless inherits_Grape_API?(node)

  add_offense(node)
end