Class: Panda::Core::Admin::Column
- Inherits:
-
Object
- Object
- Panda::Core::Admin::Column
- Defined in:
- app/components/panda/core/admin/table_component.rb
Instance Attribute Summary collapse
-
#cell ⇒ Object
readonly
Returns the value of attribute cell.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#sort_key ⇒ Object
readonly
Returns the value of attribute sort_key.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(label, width = nil, sortable: false, sort_key: nil, &block) ⇒ Column
constructor
A new instance of Column.
- #sortable? ⇒ Boolean
Constructor Details
#initialize(label, width = nil, sortable: false, sort_key: nil, &block) ⇒ Column
Returns a new instance of Column.
80 81 82 83 84 85 86 |
# File 'app/components/panda/core/admin/table_component.rb', line 80 def initialize(label, width = nil, sortable: false, sort_key: nil, &block) @label = label @width = width @sortable = sortable @sort_key = sort_key || ActiveSupport::Inflector.parameterize(label.to_s, separator: "_") @cell = block end |
Instance Attribute Details
#cell ⇒ Object (readonly)
Returns the value of attribute cell.
78 79 80 |
# File 'app/components/panda/core/admin/table_component.rb', line 78 def cell @cell end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
78 79 80 |
# File 'app/components/panda/core/admin/table_component.rb', line 78 def label @label end |
#sort_key ⇒ Object (readonly)
Returns the value of attribute sort_key.
78 79 80 |
# File 'app/components/panda/core/admin/table_component.rb', line 78 def sort_key @sort_key end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
78 79 80 |
# File 'app/components/panda/core/admin/table_component.rb', line 78 def width @width end |
Instance Method Details
#sortable? ⇒ Boolean
88 89 90 |
# File 'app/components/panda/core/admin/table_component.rb', line 88 def sortable? @sortable end |