grosser-rpx_now 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -73,6 +73,15 @@ After a primary key is mapped to an identifier, when a user logs in with this id
73
73
  `RPXNow.user_data` will contain his `primaryKey` as `:id`.
74
74
  A identifyer can only belong to one user (in doubt the last one it was mapped to)
75
75
 
76
+ ###User integration (e.g. ActiveRecord)
77
+ class User < ActiveRecord::Base
78
+ include RPXNow::UserIntegration
79
+ end
80
+
81
+ user.identifiers == RPXNow.mappings(user.id)
82
+ user.map_identifier(identifier) == RPXNow.map(identifier, user.id)
83
+ user.unmap_identifier(identifier) == RPXNow.unmap(identifier, user.id)
84
+
76
85
  TODO
77
86
  ====
78
87
  - add provider?
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 5
3
- :patch: 1
3
+ :patch: 2
4
4
  :major: 0
@@ -0,0 +1,15 @@
1
+ module RPXNow
2
+ module UserIntegration
3
+ def identifiers
4
+ RPXNow.mappings(id)
5
+ end
6
+
7
+ def map_identifier(identifier)
8
+ RPXNow.map(identifier, id)
9
+ end
10
+
11
+ def unmap_identifier(identifier)
12
+ RPXNow.unmap(identifier, id)
13
+ end
14
+ end
15
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grosser-rpx_now
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
@@ -35,6 +35,7 @@ files:
35
35
  - Rakefile
36
36
  - VERSION.yml
37
37
  - lib/rpx_now.rb
38
+ - lib/rpx_now/user_integration.rb
38
39
  - spec/rpx_now_spec.rb
39
40
  - spec/spec_helper.rb
40
41
  has_rdoc: true