Sha256: 107269aa82ed997efbde0d6d7ec1a15172f70ff159d85a92a2d40bc37eac22fb

Contents?: true

Size: 367 Bytes

Versions: 13

Compression:

Stored size: 367 Bytes

Contents

module CloudSesame
	module Query
		module Node
			class Page < Abstract

				attr_writer :page, :size, :start

        def page
					@page ||= 1
        end

				def size
					@size ||= (context && context[:size]) || 10
				end

				def start
					@start ||= (page - 1) * size
				end

				def compile
					{ start: start, size: size }
				end

			end
		end
	end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
CloudSesame-0.7.13 lib/cloud_sesame/query/node/page.rb
CloudSesame-0.7.12 lib/cloud_sesame/query/node/page.rb
CloudSesame-0.7.11 lib/cloud_sesame/query/node/page.rb
CloudSesame-0.7.10 lib/cloud_sesame/query/node/page.rb
CloudSesame-0.7.9 lib/cloud_sesame/query/node/page.rb
CloudSesame-0.7.8 lib/cloud_sesame/query/node/page.rb
CloudSesame-0.7.7 lib/cloud_sesame/query/node/page.rb
CloudSesame-0.7.5 lib/cloud_sesame/query/node/page.rb
CloudSesame-0.7.4 lib/cloud_sesame/query/node/page.rb
CloudSesame-0.7.3 lib/cloud_sesame/query/node/page.rb
CloudSesame-0.7.2 lib/cloud_sesame/query/node/page.rb
CloudSesame-0.7.1 lib/cloud_sesame/query/node/page.rb
CloudSesame-0.7.0 lib/cloud_sesame/query/node/page.rb