Class: ParamsReady::Pagination::CursorBuilder::Selector
- Inherits:
-
Object
- Object
- ParamsReady::Pagination::CursorBuilder::Selector
- Defined in:
- lib/params_ready/pagination/cursor.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
- #expression(arel_table, context) ⇒ Object
-
#initialize(key, column) ⇒ Selector
constructor
A new instance of Selector.
- #rvalue(cte) ⇒ Object
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
#column ⇒ Object (readonly)
Returns the value of attribute column.
33 34 35 |
# File 'lib/params_ready/pagination/cursor.rb', line 33 def column @column end |
#key ⇒ Object (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 |