Class: Lagoon::Analyzer::ControllerScopeCollector::Callback

Inherits:
Data
  • Object
show all
Defined in:
lib/lagoon/analyzer/ast/controller_scope_collector.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#except_actionsObject (readonly)

Returns the value of attribute except_actions

Returns:

  • (Object)

    the current value of except_actions



6
7
8
# File 'lib/lagoon/analyzer/ast/controller_scope_collector.rb', line 6

def except_actions
  @except_actions
end

#method_nameObject (readonly)

Returns the value of attribute method_name

Returns:

  • (Object)

    the current value of method_name



6
7
8
# File 'lib/lagoon/analyzer/ast/controller_scope_collector.rb', line 6

def method_name
  @method_name
end

#only_actionsObject (readonly)

Returns the value of attribute only_actions

Returns:

  • (Object)

    the current value of only_actions



6
7
8
# File 'lib/lagoon/analyzer/ast/controller_scope_collector.rb', line 6

def only_actions
  @only_actions
end

Instance Method Details

#applies_to?(action) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
11
12
# File 'lib/lagoon/analyzer/ast/controller_scope_collector.rb', line 7

def applies_to?(action)
  return false if except_actions.include?(action)
  return true if only_actions.empty?

  only_actions.include?(action)
end