Class: Cased::CollectionResponse
Instance Attribute Summary
Attributes inherited from Response
#body, #exception
Instance Method Summary
collapse
Methods inherited from Response
#error, #error?, #initialize, #success?
Instance Method Details
#first_page ⇒ Object
65
66
67
|
# File 'lib/cased/collection_response.rb', line 65
def first_page
page_from(:first)
end
|
#first_page? ⇒ Boolean
69
70
71
|
# File 'lib/cased/collection_response.rb', line 69
def first_page?
first_page.present?
end
|
#first_page_url ⇒ Object
61
62
63
|
# File 'lib/cased/collection_response.rb', line 61
def first_page_url
links[:first]
end
|
#first_page_url? ⇒ Boolean
57
58
59
|
# File 'lib/cased/collection_response.rb', line 57
def first_page_url?
first_page_url.present?
end
|
#last_page ⇒ Object
81
82
83
|
# File 'lib/cased/collection_response.rb', line 81
def last_page
page_from(:last)
end
|
#last_page? ⇒ Boolean
85
86
87
|
# File 'lib/cased/collection_response.rb', line 85
def last_page?
last_page.present?
end
|
#last_page_url ⇒ Object
77
78
79
|
# File 'lib/cased/collection_response.rb', line 77
def last_page_url
links[:last]
end
|
#last_page_url? ⇒ Boolean
73
74
75
|
# File 'lib/cased/collection_response.rb', line 73
def last_page_url?
last_page_url.present?
end
|
#next_page ⇒ Object
33
34
35
|
# File 'lib/cased/collection_response.rb', line 33
def next_page
page_from(:next)
end
|
#next_page? ⇒ Boolean
37
38
39
|
# File 'lib/cased/collection_response.rb', line 37
def next_page?
next_page.present?
end
|
#next_page_url ⇒ Object
29
30
31
|
# File 'lib/cased/collection_response.rb', line 29
def next_page_url
links[:next]
end
|
#next_page_url? ⇒ Boolean
25
26
27
|
# File 'lib/cased/collection_response.rb', line 25
def next_page_url?
next_page_url.present?
end
|
#previous_page ⇒ Object
49
50
51
|
# File 'lib/cased/collection_response.rb', line 49
def previous_page
page_from(:prev)
end
|
#previous_page? ⇒ Boolean
53
54
55
|
# File 'lib/cased/collection_response.rb', line 53
def previous_page?
previous_page.present?
end
|
#previous_page_url ⇒ Object
45
46
47
|
# File 'lib/cased/collection_response.rb', line 45
def previous_page_url
links[:prev]
end
|
#previous_page_url? ⇒ Boolean
41
42
43
|
# File 'lib/cased/collection_response.rb', line 41
def previous_page_url?
previous_page_url.present?
end
|
#results ⇒ Object
7
8
9
10
11
|
# File 'lib/cased/collection_response.rb', line 7
def results
return [] unless body
body['results']
end
|
#total_count ⇒ Object
13
14
15
16
17
|
# File 'lib/cased/collection_response.rb', line 13
def total_count
return unless body
body['total_count']
end
|
#total_pages ⇒ Object
19
20
21
22
23
|
# File 'lib/cased/collection_response.rb', line 19
def total_pages
return unless body
body['total_pages']
end
|