Class: Sirens::ColumnsBuilder
- Inherits:
-
Object
- Object
- Sirens::ColumnsBuilder
- Defined in:
- lib/components_builder/columns_builder.rb
Instance Method Summary collapse
-
#column(props = ) ⇒ Object
List columns.
- #columns ⇒ Object
- #get_popup_menu ⇒ Object
- #handlers(props) ⇒ Object
-
#initialize ⇒ ColumnsBuilder
constructor
Initializing.
-
#model(object) ⇒ Object
Current component model.
-
#popup_menu(&block) ⇒ Object
Popup menu.
- #props(props) ⇒ Object
-
#render(props, &block) ⇒ Object
Evaluating.
-
#styles(props) ⇒ Object
Current component props.
Constructor Details
#initialize ⇒ ColumnsBuilder
Initializing
5 6 7 8 9 |
# File 'lib/components_builder/columns_builder.rb', line 5 def initialize() @props = Hash[] @columns = [] @popup_menu = nil end |
Instance Method Details
#column(props = ) ⇒ Object
List columns
53 54 55 |
# File 'lib/components_builder/columns_builder.rb', line 53 def column(props = Hash[]) @columns << ColumnProps.new(props) end |
#columns ⇒ Object
11 12 13 |
# File 'lib/components_builder/columns_builder.rb', line 11 def columns() @columns end |
#get_popup_menu ⇒ Object
15 16 17 |
# File 'lib/components_builder/columns_builder.rb', line 15 def () @popup_menu end |
#handlers(props) ⇒ Object
47 48 49 |
# File 'lib/components_builder/columns_builder.rb', line 47 def handlers(props) @props.merge!(props) end |
#model(object) ⇒ Object
Current component model
33 34 35 |
# File 'lib/components_builder/columns_builder.rb', line 33 def model(object) @props[:model] = object end |
#popup_menu(&block) ⇒ Object
Popup menu
59 60 61 |
# File 'lib/components_builder/columns_builder.rb', line 59 def (&block) @popup_menu = block end |
#props(props) ⇒ Object
43 44 45 |
# File 'lib/components_builder/columns_builder.rb', line 43 def props(props) @props.merge!(props) end |
#render(props, &block) ⇒ Object
Evaluating
21 22 23 24 25 26 27 28 29 |
# File 'lib/components_builder/columns_builder.rb', line 21 def render(props, &block) @props = props @columns = [] @popup_menu = nil instance_exec(self, &block) self end |
#styles(props) ⇒ Object
Current component props
39 40 41 |
# File 'lib/components_builder/columns_builder.rb', line 39 def styles(props) @props.merge!(props) end |