Class: Sirens::ClassBrowser

Inherits:
Component show all
Defined in:
lib/sirens/components/class_browser.rb

Instance Method Summary collapse

Methods inherited from Component

#build, #create_view, #initialize, #main_child_component, #on_component_added, #open

Methods inherited from AbstractComponent

#add_all_components, #add_component, #child_components, #create_view, #default_model, #initialize, #model, #on_component_added, #on_model_changed, open, #props, #remove_component_at, #remove_last_component, #set_model, #set_props, #view

Constructor Details

This class inherits a constructor from Sirens::Component

Instance Method Details

#render_with(layout) ⇒ Object

Building



6
7
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
33
34
35
36
37
# File 'lib/sirens/components/class_browser.rb', line 6

def render_with(layout)
    browser_model = model

    layout.render do |component|
        horizontal_splitter do
            component AncestorsList.new(
                model: browser_model.module_ancestors,
                splitter_proportion: 1.0/2.0
            )

            tabs do
                styles splitter_proportion: 1.0/2.0

                component MethodsList.new(
                    model: browser_model.methods,
                    instance_or_class_methods_chooser: browser_model.instance_or_class_methods_chooser,
                    show_inherit_methods: browser_model.show_inherit_methods,
                    show_public_methods: browser_model.show_public_methods,
                    show_protected_methods: browser_model.show_protected_methods,
                    show_private_methods: browser_model.show_private_methods,
                    tab_label: 'Methods',
                    get_method_image_block: proc{ |method| method.icon }
                )

                component ConstantsList.new(
                    model: browser_model.constants,
                    tab_label: 'Constants'
                )
            end
        end
    end
end