Sha256: 64a887458b8187870ad71356b9d8fbb27e581b8c389824c251e8dc10bb30b544

Contents?: true

Size: 748 Bytes

Versions: 2

Compression:

Stored size: 748 Bytes

Contents

module Analyst
  module Entities
    class MethodCall < Entity

      handles_node :send

      def name
        name_node.to_s
      end

      def full_name
        name
      end

      def arguments
        @arguments ||= begin
          args = ast.children[2..-1]
          args.map { |arg| process_node(arg) }
        end
      end

      def constants
        if target.is_a? Analyst::Entities::Constant
          super << target
        else
          super
        end
      end

      private

      def contents
        arguments
      end

      def target_node
        ast.children.first
      end

      def target
        process_node(target_node)
      end

      def name_node
        ast.children[1]
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
analyst-0.16.1 lib/analyst/entities/method_call.rb
analyst-0.15.0 lib/analyst/entities/method_call.rb