accounts_client 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/app/models/padma_account.rb +20 -0
  2. metadata +2 -2
@@ -47,6 +47,26 @@ class PadmaAccount < LogicalModel
47
47
  :account
48
48
  end
49
49
 
50
+ def self.find_by_nucleo_id(nucleo_id, params={})
51
+ res = nil
52
+ params = self.merge_key(params)
53
+ request = Typhoeus::Request.new("#{resource_uri}/by_nucleo_id/#{nucleo_id}", params: params )
54
+
55
+ request.on_complete do |response|
56
+ if response.code >= 200 && response.code < 400
57
+ log_ok(response)
58
+ res = self.new.from_json(response.body)
59
+ else
60
+ log_failed(response)
61
+ end
62
+ end
63
+
64
+ self.hydra.queue(request)
65
+ self.hydra.run
66
+
67
+ res
68
+ end
69
+
50
70
  private
51
71
 
52
72
  # Accounts-ws uses account name of identification
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: accounts_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-26 00:00:00.000000000 Z
12
+ date: 2015-02-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties