class RubyLint::MethodCall::Include

The Include class is used for evaluating the use of `include` and `extend` method calls.

Constants

COPY_TYPES

Hash containing the source and target definition types for both `include` and `extend` method calls.

Public Instance Methods

evaluate(arguments, context, block = nil) click to toggle source

@see Base#evaluate

# File lib/ruby-lint/method_call/include.rb, line 26
def evaluate(arguments, context, block = nil)
  node_name = node.children[1]

  arguments.each do |source|
    COPY_TYPES[node_name].each do |from, to|
      source.list(from).each do |definition|
        context.add(to, definition.name, definition)
      end
    end
  end
end