Class: Babik::QuerySet::Limit

Inherits:
Object
  • Object
show all
Defined in:
lib/babik/queryset/components/limit.rb

Overview

Manages the limit of the QuerySet

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(size, offset = 0) ⇒ Limit

Construct a limit for QuerySet

Parameters:

  • size (Integer)

    Size to be selected

  • offset (Integer) (defaults to: 0)

    Offset from the selection will begin. By default is 0.



13
14
15
16
# File 'lib/babik/queryset/components/limit.rb', line 13

def initialize(size, offset = 0)
  @size = size.to_i
  @offset = offset.to_i
end

Instance Attribute Details

#offsetObject (readonly)

Returns the value of attribute offset.



8
9
10
# File 'lib/babik/queryset/components/limit.rb', line 8

def offset
  @offset
end

#sizeObject (readonly)

Returns the value of attribute size.



8
9
10
# File 'lib/babik/queryset/components/limit.rb', line 8

def size
  @size
end