accounts_client 0.0.19 → 0.0.20

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,14 +1,20 @@
1
1
  # wrapper for PADMA-Accounts Account API interaction
2
2
  # Configuration for LogicalModel on /config/initializers/logical_model.rb
3
3
  class PadmaAccount < LogicalModel
4
- self.hydra = Accounts::HYDRA
4
+ use_hydra Accounts::HYDRA
5
+ set_resource_host Accounts::HOST
6
+ set_resource_path "/v0/accounts"
5
7
 
6
- self.resource_path = "/v0/accounts"
7
- self.attribute_keys = [:id, :name, :enabled, :timezone, :email, :full_name, :nucleo_id]
8
- self.use_api_key = true
9
- self.api_key_name = "token"
10
- self.api_key = Accounts::API_KEY
11
- self.host = Accounts::HOST
8
+ attribute :id
9
+ attribute :name
10
+ attribute :enabled
11
+ attribute :timezone
12
+ attribute :email
13
+ attribute :full_name
14
+ attribute :nucleo_id
15
+ attribute :migrated_to_padma_on
16
+
17
+ set_api_key 'token', Accounts::API_KEY
12
18
 
13
19
  TIMEOUT = 5500 # milisecons
14
20
  PER_PAGE = 9999
@@ -3,32 +3,30 @@ class PadmaUser < LogicalModel
3
3
  include Gravtastic
4
4
  gravtastic
5
5
 
6
- self.hydra = Accounts::HYDRA
7
- self.use_ssl = (defined?(Rails)? Rails.env=="production" : ENV['RACK_ENV']=='production')
8
-
9
- self.resource_path = "/v0/users"
10
- self.attribute_keys = [:username,
11
- :drc_login,
12
- :email,
13
- :locale,
14
- :accounts,
15
- :current_account_name,
16
- :roles,
17
- :verbose_help,
18
- :fb_uid,
19
- :fb_token] # drc_login is OBSOLETE. remove.
20
- self.use_api_key = true
21
- self.api_key_name = "token"
22
- self.api_key = Accounts::API_KEY
23
- self.host = Accounts::HOST
6
+ use_hydra Accounts::HYDRA
7
+
8
+ set_resource_path "/v0/users"
9
+ set_resource_host Accounts::HOST
10
+
11
+ set_api_key 'token', Accounts::API_KEY
12
+
13
+ attribute :username
14
+ attribute :drc_login
15
+ attribute :email
16
+ attribute :locale
17
+ attribute :accounts
18
+ attribute :current_account_name
19
+ attribute :roles
20
+ attribute :verbose_help
21
+ attribute :fb_uid
22
+ attribute :fb_token
23
+
24
+ # LogicalModel expects an id to create resource_uri
25
+ alias_attribute :id, :username
24
26
 
25
27
  TIMEOUT = 5500 # milisecons
26
28
  PER_PAGE = 9999
27
29
 
28
- # LogicalModel expects an id to create resource_uri
29
- def id
30
- self.username
31
- end
32
30
 
33
31
  # @return [PadmaAccount]
34
32
  def current_account
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.0.19
4
+ version: 0.0.20
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: 2013-08-21 00:00:00.000000000 Z
12
+ date: 2013-09-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: 0.5.0
53
+ version: 0.5.8
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 0.5.0
61
+ version: 0.5.8
62
62
  description: This is client library for padma-Accounts-ws
63
63
  email:
64
64
  - dwaynemac@gmail.com