class ProMotion::CollectionData
Attributes
collection_view[RW]
data[RW]
Public Class Methods
new(data, collection_view)
click to toggle source
# File lib/ProMotion/collection/data/collection_data.rb, line 8 def initialize(data, collection_view) self.data = data self.collection_view = WeakRef.new(collection_view) end
Public Instance Methods
cell(params={})
click to toggle source
# File lib/ProMotion/collection/data/collection_data.rb, line 25 def cell(params={}) params = index_path_to_section_index(params) section = self.data[params[:section]] c = section.at(params[:index].to_i) set_data_cell_defaults(c) end
section(index)
click to toggle source
# File lib/ProMotion/collection/data/collection_data.rb, line 13 def section(index) sections.at(index) || [] end
section_length(index)
click to toggle source
# File lib/ProMotion/collection/data/collection_data.rb, line 21 def section_length(index) section(index).length end
sections()
click to toggle source
# File lib/ProMotion/collection/data/collection_data.rb, line 17 def sections self.data end