Class: Syskit::YARD::DSLBaseHandler

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

Instance Method Summary collapse

Instance Method Details

#processObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/yard-syskit.rb', line 18

def process
    name = call_params[0]

    klass = register(ModuleObject.new(namespace, name))
    statement.parameters.each do |p|
        if p.respond_to?(:type) && p.type == :list
            p.each do |item|
                if item.respond_to?(:type) && item.type == :assoc
                    key = item[0].jump(:ident).source
                    if key == 'parent:'
                        case obj = Proxy.new(namespace, item[1].source)
                        when ConstantObject # If a constant is included, use its value as the real object
                            obj = Proxy.new(namespace, obj.value, :module)
                        else
                            obj = Proxy.new(namespace, item[1].source, :module)
                        end

                        klass.mixins(scope).unshift(obj) unless klass.mixins(scope).include?(obj)
                    end
                end
            end
        end
    end

    if (block = statement.block)
        parse_block(block.children.first, namespace: klass)
    end
end