Class: YARD::Contextify::ContextifyHandler

Inherits:
Handlers::Ruby::Base
  • Object
show all
Defined in:
lib/yard-contextify/contextify_handler.rb

Instance Method Summary collapse

Instance Method Details

#processObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/yard-contextify/contextify_handler.rb', line 7

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