Class: UiBibz::Ui::Ux::Tables::Store
- Inherits:
-
Object
- Object
- UiBibz::Ui::Ux::Tables::Store
- Defined in:
- lib/ui_bibz/ui/ux/tables/components/store.rb
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#records ⇒ Object
Returns the value of attribute records.
Instance Method Summary collapse
- #columns ⇒ Object
-
#initialize(store) ⇒ Store
constructor
Store Use WillPaginate store methods.
- #parameters ⇒ Object
- #params ⇒ Object
Constructor Details
#initialize(store) ⇒ Store
Store Use WillPaginate store methods
11 12 13 14 15 16 17 18 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 11 def initialize(store) raise 'Store is nil!' if store.nil? raise 'Store can be created only with "table_search_pagination" method!' if store.try(:records).nil? @records = store.records @store = store @model = store.model end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
8 9 10 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 8 def model @model end |
#records ⇒ Object
Returns the value of attribute records.
7 8 9 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 7 def records @records end |
Instance Method Details
#columns ⇒ Object
24 25 26 27 28 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 24 def columns @columns ||= Columns.new(model.attribute_names.map do |attribute_name| Column.new(attribute_name, { name: attribute_name.humanize }) end) end |
#parameters ⇒ Object
34 35 36 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 34 def parameters @store.params.to_h end |
#params ⇒ Object
30 31 32 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 30 def params @store.params || {} end |