unidom-visitor 1.4 → 1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2cde4122ad81c5d0e66fc600f565ea91b273ca39
4
- data.tar.gz: 5e535fe360ef4f311127a32a078e28ef1c0799cc
3
+ metadata.gz: c5e808b5e4e4ab64f18d36094a0efa3c71daca58
4
+ data.tar.gz: 2b865e533773c563b8f5b72535863438d8c5c9cb
5
5
  SHA512:
6
- metadata.gz: f1e9fdaf5aed17e45f2b762773fa7f022b39ac4f6a9369e5003f8123705b4a859d8de700c89793f62ddffcb4354068048d8d8b3a5bff9da554e42b58e7d4d6a4
7
- data.tar.gz: 4f43d718974b39f3f512f8fefb5c415d946a52b38997e26380feb932a69c1e4c4ffb6785f71364061f7d2a239a114f138b92f95b2e5a2fd5dc89038168e2dc69
6
+ metadata.gz: 1132e4ebdded3b3ac269fc521131f4d66c42cfdceb1506246e6f520d3c3242edec3760c00944f52165b820646c181a7c5dcdde24de5900463ffecd4943ebc662
7
+ data.tar.gz: 8e62271f31589db0c47eee6c54eee630174e31c52f357dfd3bbc46daa54e8140fbabc0c0d21883d9625cac5bde11f7e4f02261efb5a8acbc12d04f052a2f9425
data/README.md CHANGED
@@ -94,11 +94,13 @@ The As Visitor concern do the following tasks for the includer automatically:
94
94
  3. Define the has_many :recognizations macro as: ``has_many :recognizations, class_name: 'Unidom::Visitor::Recognization', as: :visitor``
95
95
  4. Define the .identified_by scope as: ``scope :identified_by, ->(identity) { joins(:identificatings).merge(Unidom::Visitor::Identificating.identity_is identity) }``
96
96
  5. Define the .sign_up method as: ``sign_up(identity, password: nil, opened_at: Time.now)``
97
+ 6. Define the #is_identificated! method as: ``is_identificated!(as: nil, at: Time.now)``
97
98
 
98
99
  ### As Identity concern
99
100
 
100
101
  The As Identity concern do the following tasks for the includer automatically:
101
102
  1. Define the has_many :identificatings macro as: ``has_many :identificatings, class_name: 'Unidom::Visitor::Identificating', as: :identity``
103
+ 2. Define the #identificate! method as: ``identificate!(it, at: Time.now)``
102
104
 
103
105
  ### As Credential concern
104
106
 
@@ -6,6 +6,11 @@ module Unidom::Visitor::Concerns::AsCredential
6
6
 
7
7
  has_one :authenticating, class_name: 'Unidom::Visitor::Authenticating', as: :credential
8
8
 
9
+ #def authenticate!(it, at: Time.now, flag_code: 'RQRD')
10
+ # return authenticating if authenticating.present?
11
+ # create_authenticating! visitor: it, flag_code: flag_code, opened_at: at
12
+ #end
13
+
9
14
  end
10
15
 
11
16
  module ClassMethods
@@ -6,6 +6,10 @@ module Unidom::Visitor::Concerns::AsIdentity
6
6
 
7
7
  has_many :identificatings, class_name: 'Unidom::Visitor::Identificating', as: :identity
8
8
 
9
+ def identificate!(it, at: Time.now)
10
+ identificatings.create! visitor: it, opened_at: at
11
+ end
12
+
9
13
  end
10
14
 
11
15
  module ClassMethods
@@ -12,9 +12,33 @@ module Unidom::Visitor::Concerns::AsVisitor
12
12
 
13
13
  scope :identified_by, ->(identity) { joins(:identificatings).merge(Unidom::Visitor::Identificating.identity_is identity) }
14
14
 
15
+ def is_identificated!(as: nil, at: Time.now)
16
+ identificatings.create! identity: as, opened_at: at
17
+ end
18
+
19
+ =begin
20
+ def is_authenticated!(through: nil, at: Time.now, flag_code: 'RQRD')
21
+ authenticatings.create! credential: through, opened_at: at, flag_code: flag_code
22
+ end
23
+
24
+ def cognize!(it, at: Time.now, primary: true)
25
+ recognizations.create! party: it, elemental: primary, opened_at: at
26
+ end
27
+ =end
28
+
15
29
  end
16
30
 
17
31
  module ClassMethods
32
+
33
+ =begin
34
+ def sign_up!(it, as: nil, through: nil, at: Time.now, flag_code: 'RQRD', primary: true)
35
+ cognize! it, primary: true, at: at
36
+ is_identificated! as: as, at: at
37
+ is_authenticated! through: through, at: at
38
+ self
39
+ end
40
+ =end
41
+
18
42
  end
19
43
 
20
44
  end
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Visitor
3
- VERSION = '1.4'.freeze
3
+ VERSION = '1.5'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-visitor
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.4'
4
+ version: '1.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Topbit Du
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-07 00:00:00.000000000 Z
11
+ date: 2016-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common