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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NThhNzJhZDI1ZWMyYjllMWUzYTkwNmIwOWY5NzdmNzNhOWMyZWVhNw==
4
+ MzdiMzFlNTkzNzBlNDQ0MGMxNGRiNzk2MjNhMzBjNWUyOGQ2MmVkNw==
5
5
  data.tar.gz: !binary |-
6
- MzM2YzU2Y2M3YWFiYmNhNDYxN2FkMTRiZWYwOTUxMjE5ZTlhZmFlZQ==
6
+ NmRhMDczMGZjYTUxZGI2YmZmYmVlYmRlNzkzMzdiNzcxNmU2NjlhZA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- M2ZjOGEzZTg5ZjBiZjBlYTYxMGZjNzhkZDM1MmNjOTA0MTRkZmVhZThhZGM2
10
- ZDUxZjhiMDZiY2MxNzA0N2E3OTBhMDI2MzFjNzFlZTA1NDIzMWJmN2MwMjdj
11
- MDFhZmFlM2RjNDI1MWYwMWQ5MmUyZWI0MmI2OTZiZWI3YmMwNjk=
9
+ N2E2N2UzMzg2OWNmMmFmYzljNWJlODBiMzkyOWIyNGRmYzZiZDRlNDM2ODhj
10
+ YTBiYTc2NzZlMWQ5YWQ4ZDVmYjAyZjFkN2E4OTE2MTNhZjM1MmY1MjdmMGM2
11
+ MDliNzhmZDYzZmY2ZWM2NGIzNTZlMmU4NmIwYWQ1ZmMzYmJiZjk=
12
12
  data.tar.gz: !binary |-
13
- YTJlN2Y0Y2FlNjllZjBlNTYxOTcwOGIyN2Q5NjUwYWI3NDMwNzBiZDZiZTIw
14
- M2JlMWYxZTE5ODdjMDRlMjRhNjk1YTUyODdjMTQ2NjA3ZTZkYjVjODcyNmM1
15
- NjlkYTEzNWJkMmM1M2EyZTlmZDg4Yjk2Yzc1ODVmYzdiZGVmZTA=
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 prev_page_url; nil end
47
- def next_page_url; nil end
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
- @prev_url ||= if request.method == :get and current_page > 1
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
- @next_url ||= if @request.method == :get and total_pages > current_page
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
 
@@ -1,5 +1,5 @@
1
1
  class Fanforce
2
2
  module Api
3
- VERSION = '0.7.1'
3
+ VERSION = '0.7.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fanforce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caleb Clark