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
- #action ⇒ Object
- #actions_controller ⇒ Object
- #column_id ⇒ Object
- #columns ⇒ Object
- #controller ⇒ Object
- #current_page ⇒ Object
- #direction ⇒ Object
- #id ⇒ Object
-
#initialize(store) ⇒ Store
constructor
Store Use WillPaginate store methods.
- #limit_value ⇒ Object
- #param_id ⇒ Object
- #parameters ⇒ Object
- #params ⇒ Object
- #per_page ⇒ Object
- #search ⇒ Object
- #searchable_attributes ⇒ Object
- #sort ⇒ Object
- #total_entries ⇒ Object
- #total_pages ⇒ Object
Constructor Details
#initialize(store) ⇒ Store
Store Use WillPaginate store methods
10 11 12 13 14 15 16 17 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 10 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.
63 64 65 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 63 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
#action ⇒ Object
85 86 87 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 85 def action @store.action end |
#actions_controller ⇒ Object
73 74 75 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 73 def actions_controller @store.actions_controller end |
#column_id ⇒ Object
39 40 41 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 39 def column_id @store.column_id end |
#columns ⇒ Object
59 60 61 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 59 def columns @columns ||= Columns.new(model.attribute_names.map { |attribute_name| Column.new(attribute_name, { name: attribute_name.humanize }) }) end |
#controller ⇒ Object
69 70 71 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 69 def controller @store.controller end |
#current_page ⇒ Object
51 52 53 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 51 def current_page @records.current_page end |
#direction ⇒ Object
43 44 45 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 43 def direction @store.direction end |
#id ⇒ Object
31 32 33 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 31 def id @store.id end |
#limit_value ⇒ Object
55 56 57 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 55 def limit_value @records.limit_value end |
#param_id ⇒ Object
89 90 91 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 89 def param_id @store.param_id end |
#parameters ⇒ Object
81 82 83 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 81 def parameters @store.params.to_h end |
#params ⇒ Object
77 78 79 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 77 def params @store.params || {} end |
#per_page ⇒ Object
23 24 25 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 23 def per_page @records.per_page end |
#search ⇒ Object
65 66 67 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 65 def search @store.search end |
#searchable_attributes ⇒ Object
47 48 49 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 47 def searchable_attributes @store.searchable_attributes end |
#sort ⇒ Object
35 36 37 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 35 def sort @store.sort end |
#total_entries ⇒ Object
27 28 29 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 27 def total_entries @records.total_entries end |
#total_pages ⇒ Object
19 20 21 |
# File 'lib/ui_bibz/ui/ux/tables/components/store.rb', line 19 def total_pages @records.total_pages end |