Class: ProMotion::DataTableScreen

Inherits:
TableViewController show all
Includes:
DataTable, ScreenModule
Defined in:
lib/project/pro_motion/data_table_screen.rb

Class Method Summary collapse

Methods included from DataTable

#cell_at, #controller, #controllerDidChangeContent, #controllerWillChangeContent, #data_model, #data_scope, #fetch_controller, #fetch_scope, included, #numberOfSectionsInTableView, #object_at_index, #on_cell_created, #original_search_string, #screen_setup, #search_string, #searching?, #set_up_fetch_controller, #tableView, #table_data, #table_view, #update_table_data

Methods included from Table::Searchable

#dt_searchDisplayController, #dt_searchDisplayControllerWillBeginSearch, #dt_searchDisplayControllerWillEndSearch, #make_data_table_searchable, #new_frc_with_search, #reset_search_frc, #search_delegate, #search_fetch_controller

Methods included from Table

#set_up_searchable

Methods inherited from TableViewController

#class_handles_delegates?

Class Method Details

.data_modelObject



19
20
21
# File 'lib/project/pro_motion/data_table_screen.rb', line 19

def data_model
  @opts[:model]
end

.data_scopeObject



23
24
25
# File 'lib/project/pro_motion/data_table_screen.rb', line 23

def data_scope
  @opts[:scope]
end

.model(value, opts = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/project/pro_motion/data_table_screen.rb', line 8

def model(value, opts = {})
  if value.method_defined?(:cell)
    @opts = {
      model: value,
      scope: :all,
    }.merge(opts)
  else
    raise "#{value} must define the cell method"
  end
end