Class: ActiveScaffold::DataStructures::ActionColumns
- Includes:
- Configurable
- Defined in:
- lib/active_scaffold/data_structures/action_columns.rb
Overview
A set of columns. These structures can be nested for organization.
Defined Under Namespace
Modules: AfterConfiguration
Instance Attribute Summary collapse
-
#action ⇒ Object
this lets us refer back to the action responsible for this link, if it exists.
-
#collapsed ⇒ Object
Whether this column set is collapsed by default in contexts where collapsing is supported.
- #label ⇒ Object
Instance Method Summary collapse
-
#add_subgroup(label, &proc) ⇒ Object
nests a subgroup in the column set.
- #css_class ⇒ Object
- #include?(item) ⇒ Boolean
- #names ⇒ Object
- #names_without_auth_check ⇒ Object
Methods included from Configurable
Methods inherited from Set
#add, #each, #empty?, #exclude, #find_by_name, #find_by_names, #initialize, #length
Constructor Details
This class inherits a constructor from ActiveScaffold::DataStructures::Set
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ActiveScaffold::Configurable
Instance Attribute Details
#action ⇒ Object
this lets us refer back to the action responsible for this link, if it exists. the immediate need here is to get the crud_type so we can dynamically filter columns from the set.
8 9 10 |
# File 'lib/active_scaffold/data_structures/action_columns.rb', line 8 def action @action end |
#collapsed ⇒ Object
Whether this column set is collapsed by default in contexts where collapsing is supported
20 21 22 |
# File 'lib/active_scaffold/data_structures/action_columns.rb', line 20 def collapsed @collapsed end |
#label ⇒ Object
12 13 14 |
# File 'lib/active_scaffold/data_structures/action_columns.rb', line 12 def label as_(@label) if @label end |
Instance Method Details
#add_subgroup(label, &proc) ⇒ Object
nests a subgroup in the column set
23 24 25 26 27 28 29 30 |
# File 'lib/active_scaffold/data_structures/action_columns.rb', line 23 def add_subgroup(label, &proc) columns = ActiveScaffold::DataStructures::ActionColumns.new columns.label = label columns.action = self.action columns.configure &proc self.exclude columns.collect_columns self.add columns end |
#css_class ⇒ Object
15 16 17 |
# File 'lib/active_scaffold/data_structures/action_columns.rb', line 15 def css_class @label.to_s.underscore end |
#include?(item) ⇒ Boolean
32 33 34 35 36 37 38 |
# File 'lib/active_scaffold/data_structures/action_columns.rb', line 32 def include?(item) @set.each do |c| return true if !c.is_a? Symbol and c.include? item return true if c == item.to_sym end return false end |
#names ⇒ Object
40 41 42 |
# File 'lib/active_scaffold/data_structures/action_columns.rb', line 40 def names self.collect(&:name) end |
#names_without_auth_check ⇒ Object
44 45 46 |
# File 'lib/active_scaffold/data_structures/action_columns.rb', line 44 def names_without_auth_check Array(@set) end |