Class: SmartTable::SmartTableConcern::Params

Inherits:
Object
  • Object
show all
Defined in:
app/controllers/concerns/smart_table/smart_table_concern.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeParams

Returns a new instance of Params.



13
14
15
16
17
18
# File 'app/controllers/concerns/smart_table/smart_table_concern.rb', line 13

def initialize
  self.sort = nil
  self.page_size = nil
  self.page_number = 1
  self.search = nil
end

Instance Attribute Details

#page_numberObject

Returns the value of attribute page_number.



11
12
13
# File 'app/controllers/concerns/smart_table/smart_table_concern.rb', line 11

def page_number
  @page_number
end

#page_sizeObject

Returns the value of attribute page_size.



11
12
13
# File 'app/controllers/concerns/smart_table/smart_table_concern.rb', line 11

def page_size
  @page_size
end

#remoteObject

Returns the value of attribute remote.



11
12
13
# File 'app/controllers/concerns/smart_table/smart_table_concern.rb', line 11

def remote
  @remote
end

#searchObject

Returns the value of attribute search.



11
12
13
# File 'app/controllers/concerns/smart_table/smart_table_concern.rb', line 11

def search
  @search
end

#sortObject

Returns the value of attribute sort.



11
12
13
# File 'app/controllers/concerns/smart_table/smart_table_concern.rb', line 11

def sort
  @sort
end

Instance Method Details

#limitObject



20
21
22
# File 'app/controllers/concerns/smart_table/smart_table_concern.rb', line 20

def limit
  page_size
end

#offsetObject



24
25
26
# File 'app/controllers/concerns/smart_table/smart_table_concern.rb', line 24

def offset
  page_size * (page_number-1) if page_size
end