Module: Bumblebee::ColumnDsl
Overview
Defines a class-level interace for specifying columns.
Instance Method Summary collapse
- #all_column_sets ⇒ Object
- #all_columns ⇒ Object
- #column(header, opts = {}) ⇒ Object
- #column_set ⇒ Object
Instance Method Details
#all_column_sets ⇒ Object
27 28 29 30 31 32 |
# File 'lib/bumblebee/column_dsl.rb', line 27 def all_column_sets # the reverse preserves the order of inheritance to go from parent -> child ancestors.reverse_each.with_object(ColumnSet.new) do |ancestor, set| ancestor < Template ? set.add(ancestor.columns) : set end end |
#all_columns ⇒ Object
34 35 36 |
# File 'lib/bumblebee/column_dsl.rb', line 34 def all_columns all_column_sets.columns end |
#column(header, opts = {}) ⇒ Object
21 22 23 24 25 |
# File 'lib/bumblebee/column_dsl.rb', line 21 def column(header, opts = {}) column_set.column(header, opts) self end |