Class: RuboCop::Cop::Lint::NoJSON

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

Overview

Examples:

# bad
JSON.parse(...)

# good
MultiJson.load(...)

Constant Summary collapse

MSG =
"Use `MultiJson` instead of `JSON`."

Instance Method Summary collapse

Instance Method Details

#on_const(node) ⇒ Object



18
19
20
21
22
# File 'lib/rubocop/cop/lint/no_json.rb', line 18

def on_const(node)
  return unless is_JSON?(node)

  add_offense(node)
end