Class: Clashinator::ArrayResource::Cursor

Inherits:
Object
  • Object
show all
Defined in:
lib/clashinator/array_resource.rb

Overview

This class represent the cursor model that contains an after attribute, a before attribute or neither, for properly paging array resources

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cursor_hash) ⇒ Cursor

Returns a new instance of Cursor.



33
34
35
36
# File 'lib/clashinator/array_resource.rb', line 33

def initialize(cursor_hash)
  @after = cursor_hash['after'] if cursor_hash.key?('after')
  @before = cursor_hash['before'] if cursor_hash.key?('before')
end

Instance Attribute Details

#afterObject

Returns the value of attribute after.



31
32
33
# File 'lib/clashinator/array_resource.rb', line 31

def after
  @after
end

#beforeObject

Returns the value of attribute before.



31
32
33
# File 'lib/clashinator/array_resource.rb', line 31

def before
  @before
end