Class: Renderer::Component::Reference

Inherits:
Renderer::Component show all
Defined in:
lib/renderer/component/reference.rb

Instance Attribute Summary

Attributes inherited from Renderer::Component

#id

Instance Method Summary collapse

Methods inherited from Renderer::Component

#initialize, prop, #props, #render, #template

Constructor Details

This class inherits a constructor from Renderer::Component

Instance Method Details

#prepareObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/renderer/component/reference.rb', line 8

def prepare
  case @object
  when Docrb::Parser::Reference
    @unresolved = !@object.fulfilled?
    @path = @object.path
    return if @unresolved

    @object = @object.dereference!
    prepare
  when Docrb::Parser::Container
    @path = [@object.name]
    @ref_type = @object.kind
    parent = @object.parent
    until parent.nil?
      @path << parent.name
      parent = parent.parent
    end
    @path << ""
    @path.reverse!
  else
    @ref_type = :pure
    @value = @object[:value]
    @object = @object[:object]
  end
end