8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/yard-dm-predefined/predefine_handler.rb', line 8
def process
nobj = namespace
name = if statement.type == :predefine
statement.jump(:ident, :op, :kw, :const).source
elsif statement.call?
obj = statement.parameters(false).first
case obj.type
when :symbol_literal
obj.jump(:ident, :op, :kw, :const).source
when :string_literal
obj.jump(:string_content).source
end
end
register MethodObject.new(nobj, name, :class) do |o|
o.visibility = :public
o.source = statement.source
o.signature = "def #{nobj}.#{name}"
end
end
|