Module: Noventius::Report::Dsl::Columns::ClassMethods
- Included in:
- Noventius::Report::Dsl::ClassMethods
- Defined in:
- lib/noventius/report/dsl/columns.rb
Instance Method Summary collapse
- #column(name, type, options = {}) ⇒ Object
- #columns ⇒ Object
- #columns_group(name, children, options = {}) ⇒ Object
- #columns_names ⇒ Object
- #dynamic_columns(method_name) ⇒ Object
Instance Method Details
#column(name, type, options = {}) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/noventius/report/dsl/columns.rb', line 24 def column(name, type, = {}) validate_name_not_taken!(name) Column.new(name, type, ).tap do |column| columns_names << column.name columns << column end end |
#columns ⇒ Object
16 17 18 |
# File 'lib/noventius/report/dsl/columns.rb', line 16 def columns @columns ||= [] end |
#columns_group(name, children, options = {}) ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/noventius/report/dsl/columns.rb', line 33 def columns_group(name, children, = {}) validate_name_not_taken!(name) ColumnsGroup.new(name, children, ).tap do |columns_group| columns_names << columns_group.name children.map { |child| columns.delete(child) } columns << columns_group end end |
#columns_names ⇒ Object
20 21 22 |
# File 'lib/noventius/report/dsl/columns.rb', line 20 def columns_names @columns_names ||= [] end |
#dynamic_columns(method_name) ⇒ Object
44 45 46 |
# File 'lib/noventius/report/dsl/columns.rb', line 44 def dynamic_columns(method_name) columns << -> { send(method_name) } end |