fanforce 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/fanforce/api/response.rb +14 -8
- data/lib/fanforce/api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MzdiMzFlNTkzNzBlNDQ0MGMxNGRiNzk2MjNhMzBjNWUyOGQ2MmVkNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NmRhMDczMGZjYTUxZGI2YmZmYmVlYmRlNzkzMzdiNzcxNmU2NjlhZA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
N2E2N2UzMzg2OWNmMmFmYzljNWJlODBiMzkyOWIyNGRmYzZiZDRlNDM2ODhj
|
10
|
+
YTBiYTc2NzZlMWQ5YWQ4ZDVmYjAyZjFkN2E4OTE2MTNhZjM1MmY1MjdmMGM2
|
11
|
+
MDliNzhmZDYzZmY2ZWM2NGIzNTZlMmU4NmIwYWQ1ZmMzYmJiZjk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDU5NDMwYzdjZjBlN2NjZDI3NjVmZWE3ZjE0ZTcwMTRmNTNkOTllZWE5MjY1
|
14
|
+
MzdmZmRhYmM1MTUwMDMzN2U1YTAzOWQyOTFiZjA3OGQ5NzUyODBiODYxMTZh
|
15
|
+
NmRlMzk4MWVmYzM2YTdlYWMzMTBhMjdlOGM5YzZkYTRjODAwNjY=
|
@@ -43,8 +43,10 @@ class Fanforce::Api::Result < Hash
|
|
43
43
|
def total_results; 1 end
|
44
44
|
def current_page; 1 end
|
45
45
|
def total_pages; 1 end
|
46
|
-
def
|
47
|
-
def
|
46
|
+
def prev_page; nil end
|
47
|
+
def next_page; nil end
|
48
|
+
def prev_page_url; nil end
|
49
|
+
def next_page_url; nil end
|
48
50
|
def code; @response.code end
|
49
51
|
end
|
50
52
|
|
@@ -88,16 +90,20 @@ class Fanforce::Api::Results < Array
|
|
88
90
|
@total_pages ||= @response_hash[:total_pages]
|
89
91
|
end
|
90
92
|
|
93
|
+
def prev_page
|
94
|
+
@prev_page ||= (@request.method == :get and current_page > 1) ? current_page - 1 : nil
|
95
|
+
end
|
96
|
+
|
97
|
+
def next_page
|
98
|
+
@next_page ||= (@request.method == :get and total_pages > current_page) ? current_page + 1 : nil
|
99
|
+
end
|
100
|
+
|
91
101
|
def prev_page_url;
|
92
|
-
@
|
93
|
-
"#{@requested_url}?#{Fanforce::Utils.to_query_string(@requested_params.merge(page: current_page-1))}"
|
94
|
-
end
|
102
|
+
@prev_page_url ||= prev_page ? "#{@requested_url}?#{Fanforce::Utils.to_query_string(@requested_params.merge(page: current_page-1))}" : nil
|
95
103
|
end
|
96
104
|
|
97
105
|
def next_page_url;
|
98
|
-
@
|
99
|
-
"#{@requested_url}?#{Fanforce::Utils.to_query_string(@requested_params.merge(page: current_page+1))}"
|
100
|
-
end
|
106
|
+
@next_page_url ||= next_page ? "#{@requested_url}?#{Fanforce::Utils.to_query_string(@requested_params.merge(page: current_page+1))}" : nil
|
101
107
|
end
|
102
108
|
def code; @response.code end
|
103
109
|
|
data/lib/fanforce/api/version.rb
CHANGED