Class: SolidusAdmin::UI::Table::Component::Data
- Inherits:
-
Struct
- Object
- Struct
- SolidusAdmin::UI::Table::Component::Data
- Defined in:
- app/components/solidus_admin/ui/table/component.rb
Overview
rubocop:disable Lint/StructNewOverride,Style/StructInheritance
Instance Attribute Summary collapse
-
#batch_actions ⇒ Object
Returns the value of attribute batch_actions.
-
#class ⇒ Object
Returns the value of attribute class.
-
#columns ⇒ Object
Returns the value of attribute columns.
-
#fade ⇒ Object
Returns the value of attribute fade.
-
#next ⇒ Object
Returns the value of attribute next.
-
#prev ⇒ Object
Returns the value of attribute prev.
-
#rows ⇒ Object
Returns the value of attribute rows.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Data
constructor
A new instance of Data.
- #plural_name ⇒ Object
- #singular_name ⇒ Object
Constructor Details
#initialize(**args) ⇒ Data
Returns a new instance of Data.
12 13 14 15 16 17 18 19 |
# File 'app/components/solidus_admin/ui/table/component.rb', line 12 def initialize(**args) super self.columns = columns.map do |column| column.is_a?(Symbol) ? Column.new(wrap: false, header: column, data: column) : Column.new(wrap: false, **column) end self.batch_actions = batch_actions.to_a.map { |action| BatchAction.new(**action) } end |
Instance Attribute Details
#batch_actions ⇒ Object
Returns the value of attribute batch_actions
11 12 13 |
# File 'app/components/solidus_admin/ui/table/component.rb', line 11 def batch_actions @batch_actions end |
#class ⇒ Object
Returns the value of attribute class
11 12 13 |
# File 'app/components/solidus_admin/ui/table/component.rb', line 11 def class @class end |
#columns ⇒ Object
Returns the value of attribute columns
11 12 13 |
# File 'app/components/solidus_admin/ui/table/component.rb', line 11 def columns @columns end |
#fade ⇒ Object
Returns the value of attribute fade
11 12 13 |
# File 'app/components/solidus_admin/ui/table/component.rb', line 11 def fade @fade end |
#next ⇒ Object
Returns the value of attribute next
11 12 13 |
# File 'app/components/solidus_admin/ui/table/component.rb', line 11 def next @next end |
#prev ⇒ Object
Returns the value of attribute prev
11 12 13 |
# File 'app/components/solidus_admin/ui/table/component.rb', line 11 def prev @prev end |
#rows ⇒ Object
Returns the value of attribute rows
11 12 13 |
# File 'app/components/solidus_admin/ui/table/component.rb', line 11 def rows @rows end |
#url ⇒ Object
Returns the value of attribute url
11 12 13 |
# File 'app/components/solidus_admin/ui/table/component.rb', line 11 def url @url end |
Instance Method Details
#plural_name ⇒ Object
25 26 27 |
# File 'app/components/solidus_admin/ui/table/component.rb', line 25 def plural_name self[:class].model_name.human.pluralize if self[:class] end |
#singular_name ⇒ Object
21 22 23 |
# File 'app/components/solidus_admin/ui/table/component.rb', line 21 def singular_name self[:class].model_name.human if self[:class] end |