Class: Innodb::Cursor::StackEntry

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

Overview

An entry in a stack of cursors. The cursor position, direction, and name array are each attributes of the current cursor stack and are manipulated together.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cursor, position = 0, direction = :forward, name = nil) ⇒ StackEntry

Returns a new instance of StackEntry.



17
18
19
20
21
22
# File 'lib/innodb/cursor.rb', line 17

def initialize(cursor, position=0, direction=:forward, name=nil)
  @cursor = cursor
  @position = position
  @direction = direction
  @name = name || []
end

Instance Attribute Details

#cursorObject

Returns the value of attribute cursor.



12
13
14
# File 'lib/innodb/cursor.rb', line 12

def cursor
  @cursor
end

#directionObject

Returns the value of attribute direction.



14
15
16
# File 'lib/innodb/cursor.rb', line 14

def direction
  @direction
end

#nameObject

Returns the value of attribute name.



15
16
17
# File 'lib/innodb/cursor.rb', line 15

def name
  @name
end

#positionObject

Returns the value of attribute position.



13
14
15
# File 'lib/innodb/cursor.rb', line 13

def position
  @position
end

Instance Method Details

#dupObject



24
25
26
# File 'lib/innodb/cursor.rb', line 24

def dup
  StackEntry.new(cursor, position, direction, name.dup)
end