Class: OnlinePayments::SDK::Domain::CursorPaginationInfo

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/cursor_pagination_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#has_moretrue/false

Returns the current value of has_more.

Returns:

  • (true/false)

    the current value of has_more



11
12
13
# File 'lib/onlinepayments/sdk/domain/cursor_pagination_info.rb', line 11

def has_more
  @has_more
end

#next_cursorString

Returns the current value of next_cursor.

Returns:

  • (String)

    the current value of next_cursor



11
12
13
# File 'lib/onlinepayments/sdk/domain/cursor_pagination_info.rb', line 11

def next_cursor
  @next_cursor
end

Instance Method Details

#from_hash(hash) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'lib/onlinepayments/sdk/domain/cursor_pagination_info.rb', line 25

def from_hash(hash)
  super
  if hash.has_key? 'hasMore'
    @has_more = hash['hasMore']
  end
  if hash.has_key? 'nextCursor'
    @next_cursor = hash['nextCursor']
  end
end

#to_hHash

Returns:

  • (Hash)


18
19
20
21
22
23
# File 'lib/onlinepayments/sdk/domain/cursor_pagination_info.rb', line 18

def to_h
  hash = super
  hash['hasMore'] = @has_more unless @has_more.nil?
  hash['nextCursor'] = @next_cursor unless @next_cursor.nil?
  hash
end