Class: RedditKit::PaginatedResponse

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/redditkit/paginated_response.rb

Overview

A response object for paginated requests, allowing users to access both results and pagination data.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(before, after, results) ⇒ PaginatedResponse

Returns a new instance of PaginatedResponse.



15
16
17
18
19
# File 'lib/redditkit/paginated_response.rb', line 15

def initialize(before, after, results)
  @before = before
  @after = after
  @results = results
end

Instance Attribute Details

#afterObject (readonly)

Returns the value of attribute after.



13
14
15
# File 'lib/redditkit/paginated_response.rb', line 13

def after
  @after
end

#beforeObject (readonly)

Returns the value of attribute before.



12
13
14
# File 'lib/redditkit/paginated_response.rb', line 12

def before
  @before
end

#resultsObject (readonly)

Returns the value of attribute results.



11
12
13
# File 'lib/redditkit/paginated_response.rb', line 11

def results
  @results
end