Sha256: ffddd64c10755455fc6f1bb927b79ca235c0603f5df795ae57afde839b5cd9a0

Contents?: true

Size: 632 Bytes

Versions: 1

Compression:

Stored size: 632 Bytes

Contents

module YARD
  module Contextify
    class ContextifyHandler < YARD::Handlers::Ruby::Base

      handles method_call(:contextify)

      def process
        nobj = ModuleObject.new(:root, 'Kernel')
        mscope = scope
        name = statement.parameters[0].first

        if name.type == :symbol
          name = name.source[1..-1]

          register MethodObject.new(nobj, name, :instance) do |o|
            o.visibility = :public
            o.source = statement.source
            o.signature = "def #{name}"
            o.parameters = [['*args', nil], ['&block', nil]]
          end
        end
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yard-contextify-0.1.0 lib/yard-contextify/contextify_handler.rb