plangrade-ruby 0.3.19 → 0.3.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e7770b98eb610bcde7f98644bc0bb4eef98b318
4
- data.tar.gz: e537b268b821ffb029f3b4b106eb79163772dae2
3
+ metadata.gz: 27b6fbae5b00865db6528eec931ad215c1bfea04
4
+ data.tar.gz: 6219b0f6662096aa9fd46bea918133ba11052a8a
5
5
  SHA512:
6
- metadata.gz: 0a73391cb809827954267e1c933b81b76969c40e41be6374c58d069345567e98d4678eef72aae16b603aceb4b506c4e1425d75d4dc43d6d58558b3aa26323cea
7
- data.tar.gz: ba55e79fc38b1e179f2c17a9a32d4d4ad4e11dd276d7a414cf0b77b71b888d0180b461b751c12c7a1d2cb2b829a482490e7af238161d517c949e96a3582b180c
6
+ metadata.gz: 214a76ccfbff49d07e777364ff55822b5a3b914a260e89bff84f71083aaf6703ba3ab112f9c4907b0089adff2bfab4d0b4b6ef532f915d53ab9fc1621328f555
7
+ data.tar.gz: d87c4b803ab877cfe2e24f4ab7860f99ca3c97e81eea82d39ea947625539a648fc8d8b5f7f582af801a062908cd1e387a6a17a16887f63ea6d66fbe965a2d531
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -13,7 +13,8 @@ module Plangrade
13
13
 
14
14
  def self.get(id)
15
15
  result = api_handler.get_company(id)
16
- new(result.body)
16
+ parsed_result = JSON.parse(result.body)
17
+ new(:id => parsed_result["id"], :name => parsed_result["name"], :ein => parsed_result["ein"], :grade => parsed_result["grade"])
17
18
  end
18
19
 
19
20
  def self.all(*opts)
@@ -19,14 +19,25 @@ module Plangrade
19
19
 
20
20
  def self.get(id)
21
21
  result = api_handler.get_participant(id)
22
- participant = result.body["participant"]
23
- new(participant)
22
+ parsed_result = JSON.parse(result.body)
23
+ new(:id => parsed_result["id"], :company_id => parsed_result["company_id"], :employee_id => parsed_result["employee_id"], :first_name => parsed_result["first_name"],
24
+ :last_name => parsed_result["last_name"]), :street1 => parsed_result["street1"], :street2 => parsed_result["street2"], :city => parsed_result["city"], :state => parsed_result["state"],
25
+ :zip => parsed_result["zip"], :dob => parsed_result["dob"], :email => parsed_result["email"], :phone => parsed_result["phone"])
24
26
  end
25
27
 
26
28
  def self.all(company_id, *opts)
27
29
  opts ||= {}
28
30
  opts[:company_id] = company_id
29
- api_handler.all_participants(opts)
31
+ result = api_handler.all_participants(opts)
32
+ parsed_result = JSON.parse(result.body)
33
+ participants ||= begin
34
+ parsed_result.map do |participant|
35
+ new(:id => participant["id"], :company_id => participant["company_id"], :employee_id => participant["employee_id"], :first_name => participant["first_name"],
36
+ :last_name => participant["last_name"]), :street1 => participant["street1"], :street2 => participant["street2"], :city => participant["city"], :state => participant["state"],
37
+ :zip => participant["zip"], :dob => participant["dob"], :email => participant["email"], :phone => participant["phone"])
38
+ end
39
+ end
40
+ participants
30
41
  end
31
42
 
32
43
  def archive!
@@ -1,5 +1,5 @@
1
1
  module Plangrade
2
2
  module Ruby
3
- VERSION = "0.3.19"
3
+ VERSION = "0.3.20"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plangrade-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.19
4
+ version: 0.3.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Reynoso
metadata.gz.sig CHANGED
Binary file