Class: Cassie::Statements::Results::CursoredResult

Inherits:
Result
  • Object
show all
Includes:
Peeking, Querying
Defined in:
lib/cassie/statements/execution/results/cursored_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Peeking

#peeked_result

Methods included from Querying

#each, #first!, #success?

Methods inherited from Result

#initialize

Methods included from Core

#success?

Constructor Details

This class inherits a constructor from Cassie::Statements::Results::Result

Instance Attribute Details

#max_cursor_keyObject (readonly)

Returns the value of attribute max_cursor_key.



9
10
11
# File 'lib/cassie/statements/execution/results/cursored_result.rb', line 9

def max_cursor_key
  @max_cursor_key
end

Instance Method Details

#after_initialize(opts) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/cassie/statements/execution/results/cursored_result.rb', line 11

def after_initialize(opts)
  super
  @max_cursor_key = opts[:max_cursor_key]

  define_singleton_method "next_max_#{max_cursor_key}" do
    next_max_cursor
  end
end

#next_max_cursorObject



20
21
22
23
24
# File 'lib/cassie/statements/execution/results/cursored_result.rb', line 20

def next_max_cursor
  if peeked_row
    peeked_row[max_cursor_key]
  end
end