Sha256: 0a74574d5b38e958d7d64b6e2963b8568e34d7c283adb27af7b2aaabb6b2dcbf

Contents?: true

Size: 832 Bytes

Versions: 1

Compression:

Stored size: 832 Bytes

Contents

require 'snaptable/constructor/sortable'
require 'snaptable/constructor/collection'
require 'snaptable/constructor/renderer'

module Snaptable
  module Constructor

      class BaseTable < SimpleDelegator
        include Sortable
        include Collection
        include Renderer

        def initialize(parent, collection = nil, options = {})
          super(parent)
          @options = options
          @collection = collection || model.none
          @token = stored_token if Snaptable.use_permission
        end

        def options
          @options
        end

        def url
          :id
        end

        private

        def stored_token
          session[:token] = params[:token] if params[:token]
          return session[:token]
        end
      end

  end
end

BaseTable = Snaptable::Constructor::BaseTable

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
snaptable-1.1.1 lib/snaptable/constructor/base_table.rb