Class: Croudia::Cursor
Instance Attribute Summary collapse
-
#next_cursor ⇒ Object
readonly
Returns the value of attribute next_cursor.
-
#next_cursor_str ⇒ Object
readonly
Returns the value of attribute next_cursor_str.
-
#previous_cursor ⇒ Object
readonly
Returns the value of attribute previous_cursor.
-
#previous_cursor_str ⇒ Object
readonly
Returns the value of attribute previous_cursor_str.
Instance Method Summary collapse
- #first? ⇒ Boolean
-
#initialize(key, klass, attrs) ⇒ Cursor
constructor
A new instance of Cursor.
- #last? ⇒ Boolean
Methods inherited from Base
#[], attr_object_reader, attr_reader, #attrs, #inspect
Constructor Details
#initialize(key, klass, attrs) ⇒ Cursor
Returns a new instance of Cursor.
12 13 14 15 16 17 18 19 |
# File 'lib/croudia/cursor.rb', line 12 def initialize(key, klass, attrs) if klass.is_a?(Class) singleton_class.attr_object_reader(key => Array(klass)) else singleton_class.attr_reader(key) end super(attrs) end |
Instance Attribute Details
#next_cursor ⇒ Object (readonly)
Returns the value of attribute next_cursor.
5 6 7 |
# File 'lib/croudia/cursor.rb', line 5 def next_cursor @next_cursor end |
#next_cursor_str ⇒ Object (readonly)
Returns the value of attribute next_cursor_str.
5 6 7 |
# File 'lib/croudia/cursor.rb', line 5 def next_cursor_str @next_cursor_str end |
#previous_cursor ⇒ Object (readonly)
Returns the value of attribute previous_cursor.
5 6 7 |
# File 'lib/croudia/cursor.rb', line 5 def previous_cursor @previous_cursor end |
#previous_cursor_str ⇒ Object (readonly)
Returns the value of attribute previous_cursor_str.
5 6 7 |
# File 'lib/croudia/cursor.rb', line 5 def previous_cursor_str @previous_cursor_str end |
Instance Method Details
#first? ⇒ Boolean
21 22 23 |
# File 'lib/croudia/cursor.rb', line 21 def first? previous_cursor.zero? end |
#last? ⇒ Boolean
25 26 27 |
# File 'lib/croudia/cursor.rb', line 25 def last? next_cursor.zero? end |