Sha256: ae47d5c96f7b0611b3444c6b983b61a03478c68d728ec8070380b11ebc0c0576

Contents?: true

Size: 698 Bytes

Versions: 10

Compression:

Stored size: 698 Bytes

Contents

module ProMotion
  class CollectionData
    include ProMotion::Table::Utils
    include ProMotion::CollectionDataBuilder

    attr_accessor :data, :collection_view

    def initialize(data, collection_view)
      self.data            = data
      self.collection_view = WeakRef.new(collection_view)
    end

    def section(index)
      sections.at(index) || []
    end

    def sections
      self.data
    end

    def section_length(index)
      section(index).length
    end

    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
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ProMotion-3.0.0 lib/ProMotion/collection/data/collection_data.rb
ProMotion-2.8.2 lib/ProMotion/collection/data/collection_data.rb
ProMotion-2.8.1 lib/ProMotion/collection/data/collection_data.rb
ProMotion-2.8.0 lib/ProMotion/collection/data/collection_data.rb
ProMotion-2.7.1 lib/ProMotion/collection/data/collection_data.rb
ProMotion-2.7.0 lib/ProMotion/collection/data/collection_data.rb
ProMotion-2.6.1 lib/ProMotion/collection/data/collection_data.rb
ProMotion-2.6.0 lib/ProMotion/collection/data/collection_data.rb
ProMotion-2.5.0 lib/ProMotion/collection/data/collection_data.rb
ProMotion-2.5.0.beta1 lib/ProMotion/collection/data/collection_data.rb