shelby-arena-api 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 286a00451cb45c4c1ec216af4e7b81835d2dc4de
4
- data.tar.gz: 6c0ec078bdc7785ecca6d6085fc16e24099aa354
3
+ metadata.gz: dac7e6387d9d19b89f532ff3fe0937fad1d85343
4
+ data.tar.gz: 1dff33293efbe9f5b123348b128c915cd97a6e66
5
5
  SHA512:
6
- metadata.gz: 6931cf678080cd2d3dc19161d3f6c50a33dbd8d970265e3528226cf3461ebe31cae1808a18d4b72538d234fc1a5ea91fe30242cf8e75066f450a8fd519e625d7
7
- data.tar.gz: cefae2f5de8fd254ebd219347e2f4f3660990a20c1fa3590b49739e231e87097fcdfdb8c77ebdc61776ca9b9a0d3fda205ba86313b9052b660d4d2a40ce12a7f
6
+ metadata.gz: 4519cd18a4ecc36e6462aaf38e71e74aaf357e3608549837d5dcccd774bb929e70df4c5987e96b63c7e5566cd40944e1a88dbcb22cf5ae7cdd730bf04b4485d9
7
+ data.tar.gz: 2f169343cd179c562a848a284f5891433a0c476908290189794c077bb84c1b126ee59dbe30c066a3cd85902b6a82495e2ab26f879f82fe13b54fd9c97de8271e
@@ -2,14 +2,14 @@ module ShelbyArena
2
2
 
3
3
  class Search
4
4
 
5
- def self.search_for_contributions_by_date_range(start_date, end_date)
6
- options = {from_date: start_date, to_date: end_date}
5
+ def self.search_for_contributions_by_date_range(start_date, end_date, page=1, per_page=100)
6
+ options = {from_date: start_date, to_date: end_date, page_index: page, page_size: per_page}
7
7
  reader = ShelbyArena::ContributionListReader.new(options)
8
8
  ContributionList.new({reader: reader})
9
9
  end
10
10
 
11
- def self.search_for_contributions_by_person(first_name, last_name)
12
- options = {first_name: first_name, last_name: last_name}
11
+ def self.search_for_contributions_by_person(first_name, last_name, page=1, per_page=100)
12
+ options = {first_name: first_name, last_name: last_name, page_index: page, page_size: per_page}
13
13
  reader = ShelbyArena::ContributionListReader.new(options)
14
14
  ContributionList.new({reader: reader})
15
15
  end
@@ -25,8 +25,8 @@ module ShelbyArena
25
25
  when :delete
26
26
  raise 'Shelby DELETE not tested yet'
27
27
  # Typhoeus::Request.delete(url, {:headers => headers, :params => params})
28
- end
29
-
28
+ end
29
+
30
30
  if !response.success?
31
31
  if response.code > 0
32
32
  raise ShelbyArenaExceptions::UnableToConnectToShelbyArena.new(response.body)
@@ -40,18 +40,18 @@ module ShelbyArena
40
40
  raise ShelbyArenaExceptions::ShelbyArenaResponseError.new(error_messages)
41
41
  end
42
42
  end
43
- end
44
-
43
+ end
44
+
45
45
  response
46
- end
46
+ end
47
47
 
48
48
 
49
49
  def self._xml2json(xml)
50
- # {KeepRoot: true, ForceArray: false, SuppressEmpty: true} were set to
50
+ # {KeepRoot: true, ForceArray: false, SuppressEmpty: true} were set to
51
51
  # maximize compatibility with Hash.from_xml, used previously.
52
52
  #
53
53
  XmlSimple.xml_in(xml, {KeepRoot: true, ForceArray: false, SuppressEmpty: true})
54
- end
54
+ end
55
55
 
56
56
 
57
57
  def self._generate_api_signature(path, params)
@@ -71,5 +71,5 @@ module ShelbyArena
71
71
  .gsub(/([a-z\d])([A-Z])/,'\1_\2')
72
72
  .tr("-", "_")
73
73
  .downcase
74
- end
74
+ end
75
75
  end
@@ -7,14 +7,16 @@ module ShelbyArena
7
7
  # Options:
8
8
  # :person_id - (optional) search for receipts containing the PersonId that is passed with this parameter.
9
9
  # :start_date - (optional) search for receipts with a received date greater than or equal to this parameter.
10
- # :end_date - (optional) search for receipts with a received date less than or equal to this parameter.
10
+ # :end_date - (optional) search for receipts with a received date less than or equal to this parameter.
11
11
  def initialize(options = {})
12
12
  # page = options[:page] || 1
13
13
  # per_page = options[:per_page] || 100
14
14
 
15
15
  @url_data_params = {}
16
16
  valid_fields.each { |field| @url_data_params[field] = options[ShelbyArena::attr_underscore(field).to_sym] unless options[ShelbyArena::attr_underscore(field).to_sym].nil? }
17
- @url_data_path = 'contribution/list'
17
+ @url_data_params['pageIndex'] = options[:page_index]
18
+ @url_data_params['pageSize'] = options[:page_size]
19
+ @url_data_path = 'contribution/list'
18
20
 
19
21
  end
20
22
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  PROJECT_GEM = 'shelby-arena-api'
3
- PROJECT_GEM_VERSION = '0.2.1'
3
+ PROJECT_GEM_VERSION = '0.2.2'
4
4
 
5
5
  s.name = PROJECT_GEM
6
6
  s.version = PROJECT_GEM_VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shelby-arena-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wes Hays
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-23 00:00:00.000000000 Z
12
+ date: 2014-10-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: typhoeus