Sha256: f5782de7e1707268f6f030b09cb50994264cac40ef19f34b7af439f1fe10368c

Contents?: true

Size: 856 Bytes

Versions: 9

Compression:

Stored size: 856 Bytes

Contents

module Analyst
  module Entities

    class InstanceMethod < Entity

      handles_node :def

      def kind
        "Instance Method"
      end

      def name
        ast.children.first.to_s
      end

      def full_name
        parent.full_name + '#' + name
      end
    end

    class ClassMethod < Entity
      def kind
        "Class Method"
      end

      def name
        ast.children.first.to_s
      end

      def full_name
        parent.full_name + '::' + name
      end
    end

    class SingletonMethod < Entity

      handles_node :defs

      # NOTE: not a public API -- used by Entities::Class
      def target
        target, name, params, content = ast.children
        target
      end

      def name
        ast.children[1].to_s
      end

      def full_name
        parent.full_name + '::' + name
      end
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
analyst-1.2.4 lib/analyst/entities/method.rb
analyst-1.2.3 lib/analyst/entities/method.rb
analyst-1.2.2 lib/analyst/entities/method.rb
analyst-1.2.1 lib/analyst/entities/method.rb
analyst-1.2.0 lib/analyst/entities/method.rb
analyst-1.0.1 lib/analyst/entities/method.rb
analyst-1.0.0 lib/analyst/entities/method.rb
analyst-0.16.1 lib/analyst/entities/method.rb
analyst-0.15.0 lib/analyst/entities/method.rb