kiva_api 0.1.9 → 0.1.10

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: 1b822e1c42bf7615780d7e81fb731ea0bb510444
4
- data.tar.gz: a0d5474772ec4f8e13411173abda5bf23b150f24
3
+ metadata.gz: 27b82a3dc418f560f9f03a21cdae4d49a6e9ab7c
4
+ data.tar.gz: 4c9da55694859b9ffebe972312646c78e525112a
5
5
  SHA512:
6
- metadata.gz: 5144091323146f9183d079c6c6f7a80947565ebb662950f5b2705ee6523726aa9c5e5380c8c604c3fe3f03863aee5e5025ae34927ce3a3245bc5363c77270da5
7
- data.tar.gz: 14d19e7293dd9892a1b2099bbe6365e6c48f16ee9775b4ddcfe4be216be9408cbb5bcb802f56674b1308a4f77012168b5234a1b68d5946707444c4c878283daa
6
+ metadata.gz: 780df67247f5877c37ba7bc1fd408aa9cabaab8ea21d34b41e15544153a7285f87d4bd21a0ab30b6d6eb05193511ce88401b6ea0ae9024013009cc7b6735bc65
7
+ data.tar.gz: a4cf4e0fc3f07b7cf94ad72234049f0a41a9ed6306bcc928d09a3b8029890185e49396ce80558b9cf7be105cd6623b163f2726e407a7517ed4f804a894404154
data/README.md CHANGED
@@ -7,7 +7,7 @@ Get Loan data from Kiva's API
7
7
  Add this line to your application's Gemfile:
8
8
 
9
9
  ```ruby
10
- gem 'kiva_api', '~> 0.1.8'
10
+ gem 'kiva_api', '~> 0.1.10'
11
11
  ```
12
12
 
13
13
  And then execute:
@@ -1,8 +1,8 @@
1
1
  class KivaApi::CommentsResponse
2
2
  attr_reader :response
3
3
 
4
- def initialize(response)
5
- @response = response.parsed_response
4
+ def initialize(parsed_response)
5
+ @response = parsed_response
6
6
  end
7
7
 
8
8
  def comments
@@ -1,8 +1,8 @@
1
1
  class KivaApi::LendersResponse
2
2
  attr_reader :response
3
3
 
4
- def initialize(response)
5
- @response = response.parsed_response
4
+ def initialize(parsed_response)
5
+ @response = parsed_response
6
6
  end
7
7
 
8
8
  def lender_count
data/lib/kiva_api/loan.rb CHANGED
@@ -15,13 +15,13 @@ class KivaApi::Loan
15
15
 
16
16
  def get_data(verify = true)
17
17
  loan_response = HTTParty.get("#{@loan_root}/#{@loan_number}/", verify: verify)
18
- @loan = KivaApi::LoanResponse.new(loan_response)
18
+ @loan = KivaApi::LoanResponse.new(loan_response.parsed_response)
19
19
  terms_response = HTTParty.get("#{@loan_root}/#{@loan_number}/terms", verify: verify)
20
- @terms = KivaApi::TermsResponse.new(terms_response)
20
+ @terms = KivaApi::TermsResponse.new(terms_response.parsed_response)
21
21
  comments_response = HTTParty.get("#{@loan_root}/#{@loan_number}/comments", verify: verify)
22
- @comments = KivaApi::CommentsResponse.new(comments_response)
22
+ @comments = KivaApi::CommentsResponse.new(comments_response.parsed_response)
23
23
  lenders_response = HTTParty.get("#{@loan_root}/#{@loan_number}/lenders", verify: verify)
24
- @lenders = KivaApi::LendersResponse.new(lenders_response)
24
+ @lenders = KivaApi::LendersResponse.new(lenders_response.parsed_response)
25
25
  end
26
26
 
27
27
  private
@@ -1,16 +1,12 @@
1
1
  class KivaApi::LoanResponse
2
2
  attr_reader :response
3
3
 
4
- def initialize(response)
5
- @response = response
6
- end
7
-
8
- def parsed_body
9
- @response.parsed_response
4
+ def initialize(parsed_response)
5
+ @response = parsed_response
10
6
  end
11
7
 
12
8
  def properties
13
- parsed_body['properties']
9
+ response['properties']
14
10
  end
15
11
 
16
12
  def id
@@ -1,8 +1,8 @@
1
1
  class KivaApi::TermsResponse
2
2
  attr_reader :response
3
3
 
4
- def initialize(response)
5
- @response = response
4
+ def initialize(parsed_response)
5
+ @response = parsed_response
6
6
  end
7
7
 
8
8
  def expected_payments
@@ -1,3 +1,3 @@
1
1
  module KivaApi
2
- VERSION = "0.1.9"
2
+ VERSION = "0.1.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kiva_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Magelowitz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-18 00:00:00.000000000 Z
11
+ date: 2016-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty