RailsRunSignUp 0.0.5 → 0.0.7

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
- YWJkYjBkNTExNDIyOTJmZmU4MDQwMWVlNjEyYzcxNDAzNzQzYzVkMw==
4
+ NWQ2ZWIyZjk5YTBhM2QwZWYwOTc3ZDAzODRkMzEwNDkxNmM5NGNhYw==
5
5
  data.tar.gz: !binary |-
6
- NTVkZGNmNTg4ZmU0YTlkOTBhYTczZmY5OTIzYjlkZDkxNDRkMjhkYQ==
6
+ OTc5NWYzNDNlMDFiMDk1YzA4NmVlYWY1ZjFlNjc4MTI5MGY1OTg3YQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NjQ3ZGRmNDFhZGMxZTIzZTVmOTBkMjk1MTRmMDEwNTM2NGYxZTlhOWZjYjVi
10
- MDVkYzM3ZGQ2YmUxMTM5NTk4NDI2MjdhMzQ1YTM4YjQxZDUwOGJlZTdhMGRl
11
- OTY2YjBkYjk5ZDA2ODhmMjUyNTU0MjcyNTZmM2RmMWZjZDM4MjE=
9
+ ZmQwZDA3N2E5ZTUyYjRhMTNkYjEyNDQ5OWQwNjgyMDQzYmZiNDJiZDc3MmRl
10
+ NTBkMWY1ZWVhZDRhY2IyN2JmMTk2MzM2NWM1NTYwMGI3ZDdiOTk2NDFjZDk3
11
+ NGQzM2E5YzhhZjJhOTBlOWE2OTA5MzVkOTFmM2Y1MGRiNmM4MTU=
12
12
  data.tar.gz: !binary |-
13
- MTk3YjdiZjdiMjE3NDE0NWYxNmEzZDRjNmNkNWQxYTExZDZjZDQyMWJkNDlm
14
- ODk3YjI2NWM5M2UxZTkzMmIxMTkwZGNjYThjMDYxYzZlZGZkODAyOGE5YzVi
15
- ZTI4MjhkYjUwN2IyN2I4NDhkMWMzMmU0NGJjNjFhYTE5MTYwZTk=
13
+ MGIzODRjNTk2YjQwYzY1ZmNmNzY4ZWE5ODhmOTM2MDA5ODA0MzRhZjFhZjE0
14
+ NzVmNTQ0ZTAzMWQzOWVlZjA0Y2VlNzM2ODJkYjM4ZTkxNDllMDQ4MGQ1OTE3
15
+ MjJhY2ZmMmY2YmRjNjk2MDk3NDJiYTEzMDFhOGQ1MDI3NTIxZWM=
@@ -9,6 +9,8 @@ module RailsRunSignUp
9
9
  attr_reader :first_name
10
10
  # users last name
11
11
  attr_reader :last_name
12
+ # users email
13
+ attr_reader :email
12
14
  # users street address
13
15
  attr_reader :street
14
16
  # users city address
@@ -35,6 +37,32 @@ module RailsRunSignUp
35
37
  attr_reader :chip_num
36
38
  # users age at time of race
37
39
  attr_reader :age
40
+ # registration date
41
+ attr_reader :registration_date
42
+ # last modified time of info
43
+ attr_reader :last_modified
44
+ # if imported
45
+ attr_reader :imported
46
+ # processing fee
47
+ attr_reader :processing_fee
48
+ # processing fee by user
49
+ attr_reader :processing_fee_paid_by_user
50
+ # processing fee by race
51
+ attr_reader :processing_fee_paid_by_race
52
+ # partner fee
53
+ attr_reader :partner_fee
54
+ # affiliate profit
55
+ attr_reader :affiliate_profit
56
+ # extra fee
57
+ attr_reader :extra_fees
58
+ # amt paid
59
+ attr_reader :amount_paid
60
+ # usatf discount amount in cents
61
+ attr_reader :usatf_discount_amount_in_cents
62
+ # usatf discount additional
63
+ attr_reader :usatf_discount_additional_field
64
+ # items give away by races
65
+ attr_reader :giveaway
38
66
  end
39
67
  end
40
68
  end
@@ -28,9 +28,12 @@ module RailsRunSignUp
28
28
  raise RailsRunSignUp::ParticipantsError, "Parameter missing {event_id}" if opts[:event_id].nil?
29
29
 
30
30
  response = @access_token.get("/Rest/race/#{opts[:race_id]}/participants/?format=json&#{opts.map{|k, v| "#{k}=#{v}"}.join('&')}")
31
- json_response = JSON.parse(response.body).first #response is encased in an array?
31
+ error_response = JSON.parse(response.body)
32
+ json_response = JSON.parse(response.body).first
32
33
 
33
- raise RailsRunSignUp::ParticipantsError, "RunSignUp participants.get Error: #{json_response['error']['error_code']} - #{json_response['error']['error_msg']}" unless json_response['error'].nil?
34
+ if error_response.is_a?(Hash)
35
+ raise RailsRunSignUp::ParticipantsError, "RunSignUp participants.get Error: #{error_response['error']['error_code']} - #{error_response['error']['error_msg']}" unless error_response['error'].nil?
36
+ end
34
37
 
35
38
  parse_json json_response
36
39
  end
@@ -44,7 +47,8 @@ module RailsRunSignUp
44
47
  _participant = RailsRunSignUp::Model::User.new(
45
48
  :user_id => participant['user']['user_id'],
46
49
  :first_name => participant['user']['first_name'],
47
- :last_name => participant['user']['email'],
50
+ :last_name => participant['user']['last_name'],
51
+ :email => participant['user']['email'],
48
52
  :street => participant['user']['address']['street'],
49
53
  :city => participant['user']['address']['city'],
50
54
  :state => participant['user']['address']['state'],
@@ -59,21 +63,22 @@ module RailsRunSignUp
59
63
  :chip_num => participant['chip_num'],
60
64
  :age => participant['age'],
61
65
  :registration_date => participant['registration_date'],
62
- :last_modified => participant['last_modified'],
63
- :imported => participant['imported'],
64
- :processing_fee => participant['processing_fee'],
66
+ :last_modified => participant['last_modified'], #
67
+ :imported => participant['imported'],
68
+ :processing_fee => participant['processing_fee'],
65
69
  :processing_fee_paid_by_user => participant['processing_fee_paid_by_user'],
66
70
  :processing_fee_paid_by_race => participant['processing_fee_paid_by_race'],
67
- :partner_fee => participant['partner_fee'],
71
+ :partner_fee => participant['partner_fee'],
68
72
  :affiliate_profit => participant['affiliate_profit'],
69
73
  :extra_fees => participant['extra_fees'],
70
74
  :amount_paid => participant['amount_paid'],
71
- :usatf_discount_amount_in_cents => participant['usatf_discount_amount_in_cents'],
72
- :usatf_discount_additional_field => participant['usatf_discount_additional_field'],
75
+ :usatf_discount_amount_in_cents => participant['usatf_discount_amount_in_cents'], #
76
+ :usatf_discount_additional_field => participant['usatf_discount_additional_field'], #
73
77
  :giveaway => participant['giveaway']
74
78
  )
75
79
  self.add_user _participant
76
80
  end
81
+ self.users
77
82
  end
78
83
 
79
84
  def add_user user
@@ -81,4 +86,4 @@ module RailsRunSignUp
81
86
  self.users << user
82
87
  end
83
88
  end
84
- end
89
+ end
@@ -1,3 +1,3 @@
1
1
  module RailsRunSignUp
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -35,4 +35,4 @@ describe RailsRunSignUp do
35
35
  users = rails_sign_up.get_participants opts
36
36
  users.should_not be_nil
37
37
  end
38
- end
38
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: RailsRunSignUp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Slone
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-30 00:00:00.000000000 Z
11
+ date: 2013-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler