Class: ParamsReady::Pagination::CursorBuilder::Selector

Inherits:
Object
  • Object
show all
Defined in:
lib/params_ready/pagination/cursor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, column) ⇒ Selector

Returns a new instance of Selector.



35
36
37
38
39
# File 'lib/params_ready/pagination/cursor.rb', line 35

def initialize(key, column)
  @key = key
  @column = column
  freeze
end

Instance Attribute Details

#columnObject (readonly)

Returns the value of attribute column.



33
34
35
# File 'lib/params_ready/pagination/cursor.rb', line 33

def column
  @column
end

#keyObject (readonly)

Returns the value of attribute key.



32
33
34
# File 'lib/params_ready/pagination/cursor.rb', line 32

def key
  @key
end

Instance Method Details

#expression(arel_table, context) ⇒ Object



41
42
43
# File 'lib/params_ready/pagination/cursor.rb', line 41

def expression(arel_table, context)
  column.attribute(key, arel_table, context)
end

#rvalue(cte) ⇒ Object



45
46
47
# File 'lib/params_ready/pagination/cursor.rb', line 45

def rvalue(cte)
  cte.project(key)
end