Class: RuboCop::Cop::Yattho::DeprecatedLayoutComponent

Inherits:
BaseCop
  • Object
show all
Defined in:
lib/rubocop/cop/yattho/deprecated_layout_component.rb

Overview

This cop ensures that the deprecated ‘Yattho::LayoutComponent` isn’t used.

bad Yattho::LayoutComponent.new(foo: :deprecated)

good Yattho::Alpha::Layout.new(foo: :deprecated)

Constant Summary collapse

MSG =
"Please try Yattho::Alpha::Layout instead."

Instance Method Summary collapse

Methods inherited from BaseCop

#valid_node?

Instance Method Details

#on_send(node) ⇒ Object



22
23
24
25
26
# File 'lib/rubocop/cop/yattho/deprecated_layout_component.rb', line 22

def on_send(node)
  return unless legacy_component?(node)

  add_offense(node, message: MSG)
end