Class: RuboCop::Cop::Doctolib::Verify

Inherits:
Struct
  • Object
show all
Defined in:
lib/rubocop/cop/doctolib/no_asymmetrical_pundit_after_actions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nodeObject

Returns the value of attribute node

Returns:

  • (Object)

    the current value of node



8
9
10
# File 'lib/rubocop/cop/doctolib/no_asymmetrical_pundit_after_actions.rb', line 8

def node
  @node
end

Instance Method Details

#actionsObject



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

def actions
  actions = only_or_except_kwarg&.value
  return if actions.nil?
  normalize actions
end

#argumentsObject



10
11
12
# File 'lib/rubocop/cop/doctolib/no_asymmetrical_pundit_after_actions.rb', line 10

def arguments
  node.arguments[1...]
end

#covers_all?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/rubocop/cop/doctolib/no_asymmetrical_pundit_after_actions.rb', line 14

def covers_all?
  arguments.empty?
end

#modeObject



18
19
20
# File 'lib/rubocop/cop/doctolib/no_asymmetrical_pundit_after_actions.rb', line 18

def mode
  only_or_except_kwarg&.key&.value
end