finapps 0.0.24.pre → 0.1.1.pre

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: e74cf110cb65f3ec8dc11fb52a17da5b2394290e
4
- data.tar.gz: 5743b81e39cd81e90f4e1f20c13ff1a362dd4bce
3
+ metadata.gz: 58dcf239755903d83b1cd5b250a6e37cfe637135
4
+ data.tar.gz: 8f9808d612b86472df9f4ad56aa6fe79800835be
5
5
  SHA512:
6
- metadata.gz: 6ef35c4c24b9d44412a4ff85c94c426cf5c83e7f183b077fa5fb3a33f0c7d17ac99293b17ec4c28cd075190a81f6791572b6b533f1be1512357a29f946fd0195
7
- data.tar.gz: 8ee328c6519450966dcd17ba072abe34f0b8ce64e50f19b581cbcf30d6f326bea926cb4f93e5e3d281906e7d1720f372538706816514a78ce7a24c49d0ddecd7
6
+ metadata.gz: b84d1e67d8f0e3a9ce0e0e2955333b3ae68073230c50acd7905d83c4b7abbd68112f3c31c6960502cdb6d875a82d508daa0e1dc861053cc0bc49feea52e99ca9
7
+ data.tar.gz: ac1d594cc3bf5d829e23557255fc4152ced23810cbba101541505b8a3d13459c363306a5f4d2d17fc83e199ba8a24bc38a2ffd03f5d39552486ce4cfa073b3e5
data/lib/finapps.rb CHANGED
@@ -11,15 +11,14 @@ require 'finapps/rest/defaults'
11
11
  require 'finapps/rest/errors'
12
12
  require 'finapps/utils/logging'
13
13
  require 'finapps/utils/utils'
14
+ require 'finapps/middleware/api_token'
15
+ require 'finapps/middleware/raise_http_exceptions'
16
+ require 'finapps/middleware/response_logger'
14
17
 
15
18
  require 'finapps/rest/resource'
16
19
  require 'finapps/rest/resources'
17
20
  require 'finapps/rest/users'
18
21
  require 'finapps/rest/institutions'
19
-
20
- require 'finapps/middleware/api_token'
21
- require 'finapps/middleware/raise_http_exceptions'
22
- require 'finapps/middleware/response_logger'
23
-
22
+ require 'finapps/rest/user_institutions'
24
23
  require 'finapps/rest/connection'
25
24
  require 'finapps/rest/client'
@@ -152,6 +152,7 @@ module FinApps
152
152
  def set_up_resources
153
153
  @users ||= FinApps::REST::Users.new self
154
154
  @institutions ||= FinApps::REST::Institutions.new self
155
+ @user_institutions ||= FinApps::REST::UserInstitutions.new self
155
156
  end
156
157
 
157
158
  end
@@ -28,7 +28,7 @@ module FinApps
28
28
  :users_delete => 'users/:public_id/delete',
29
29
  :institutions_search => 'institutions/:search_term/search',
30
30
  :institutions_form => 'institutions/:site_id/form',
31
- :institutions_add => 'institutions/:site_id/add',
31
+ :user_institutions_add => 'institutions/:site_id/add'
32
32
  }
33
33
 
34
34
  end
@@ -0,0 +1,37 @@
1
+ module FinApps
2
+ module REST
3
+
4
+ require 'erb'
5
+
6
+ class UserInstitutions < FinApps::REST::Resources
7
+ include FinApps::REST::Defaults
8
+
9
+ def add(site_id, parameters)
10
+ logger.debug "##{__method__.to_s} => Started"
11
+
12
+ raise MissingArgumentsError.new 'Missing argument: site_id.' if site_id.blank?
13
+ logger.debug "##{__method__.to_s} => site_id: #{site_id}"
14
+
15
+ raise MissingArgumentsError.new 'Missing argument: parameters.' if parameters.blank?
16
+ logger.debug "##{__method__.to_s} => parameters: #{parameters.inspect}"
17
+
18
+ end_point = Defaults::END_POINTS[:user_institutions_add]
19
+ logger.debug "##{__method__.to_s} => end_point: #{end_point}"
20
+
21
+ path = end_point.sub ':site_id', ERB::Util.url_encode(site_id)
22
+ logger.debug "##{__method__.to_s} => path: #{path}"
23
+
24
+ user_institution, error_messages = @client.post(path) { |r| UserInstitution.new(r.body) }
25
+
26
+ logger.debug "##{__method__.to_s} => Completed"
27
+ return user_institution, error_messages
28
+ end
29
+
30
+ end
31
+
32
+ class UserInstitution < FinApps::REST::Resource
33
+ attr_accessor :_id, :account_id, :user_public_id, :institution_name, :status, :status_message
34
+ end
35
+
36
+ end
37
+ end
@@ -1,3 +1,3 @@
1
1
  module FinApps
2
- VERSION = '0.0.24.pre'
2
+ VERSION = '0.1.1.pre'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: finapps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.24.pre
4
+ version: 0.1.1.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erich Quintero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-21 00:00:00.000000000 Z
11
+ date: 2014-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -205,6 +205,7 @@ files:
205
205
  - lib/finapps/rest/institutions.rb
206
206
  - lib/finapps/rest/resource.rb
207
207
  - lib/finapps/rest/resources.rb
208
+ - lib/finapps/rest/user_institutions.rb
208
209
  - lib/finapps/rest/users.rb
209
210
  - lib/finapps/utils/logging.rb
210
211
  - lib/finapps/utils/utils.rb
@@ -237,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
238
  version: 1.3.1
238
239
  requirements: []
239
240
  rubyforge_project:
240
- rubygems_version: 2.2.2
241
+ rubygems_version: 2.4.1
241
242
  signing_key:
242
243
  specification_version: 4
243
244
  summary: FinApps REST API ruby client.