Class: Sirens::MethodsList

Inherits:
Component show all
Defined in:
lib/sirens/components/methods_list.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



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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/sirens/components/methods_list.rb', line 7

def render_with(layout)
    layout.render do |component|
        vertical_stack do

             horizontal_stack do
                 styles(
                     height: 30,
                     stack_expand: false
                 )

                radio_buttons_group do
                    radio_button label: 'instance',
                        id: :instance,
                        model: component.props[:instance_or_class_methods_chooser],
                        stack_expand: false

                    radio_button label: 'class',
                        id: :class,
                        model: component.props[:instance_or_class_methods_chooser],
                        stack_expand: false
                end

                checkbox label: 'include inherit',
                    model: component.props[:show_inherit_methods]
             end

            choices_list do
                model component.model

                styles id: :methods_list,
                    show_headers: false

                column label: '',
                    get_image_block: component.props[:get_method_image_block]

                column label: 'Methods',
                    get_text_block: proc{ |method| method.name }
            end

            horizontal_stack do
                styles(
                    height: 30,
                    stack_expand: false
                )

                checkbox label: 'public',
                    model: component.props[:show_public_methods]

                checkbox label: 'protected',
                    model: component.props[:show_protected_methods]

                checkbox label: 'private',
                    model: component.props[:show_private_methods]
            end

        end
    end
end