Class: ModelContextProtocol::Server::Pagination::PaginatedResponse

Inherits:
Data
  • Object
show all
Defined in:
lib/model_context_protocol/server/pagination.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#itemsObject (readonly)

Returns the value of attribute items

Returns:

  • (Object)

    the current value of items



12
13
14
# File 'lib/model_context_protocol/server/pagination.rb', line 12

def items
  @items
end

#next_cursorObject (readonly)

Returns the value of attribute next_cursor

Returns:

  • (Object)

    the current value of next_cursor



12
13
14
# File 'lib/model_context_protocol/server/pagination.rb', line 12

def next_cursor
  @next_cursor
end

Instance Method Details

#serialized(key) ⇒ Object



13
14
15
16
17
# File 'lib/model_context_protocol/server/pagination.rb', line 13

def serialized(key)
  result = {key => items}
  result[:nextCursor] = next_cursor if next_cursor
  result
end