unidom-visitor 1.5 → 1.6

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: c5e808b5e4e4ab64f18d36094a0efa3c71daca58
4
- data.tar.gz: 2b865e533773c563b8f5b72535863438d8c5c9cb
3
+ metadata.gz: 96fd80a898725ebc4621d3aceefa83df097c1dd7
4
+ data.tar.gz: c6d4e8f259349c90e5697dc5d67e9e3df0c0d057
5
5
  SHA512:
6
- metadata.gz: 1132e4ebdded3b3ac269fc521131f4d66c42cfdceb1506246e6f520d3c3242edec3760c00944f52165b820646c181a7c5dcdde24de5900463ffecd4943ebc662
7
- data.tar.gz: 8e62271f31589db0c47eee6c54eee630174e31c52f357dfd3bbc46daa54e8140fbabc0c0d21883d9625cac5bde11f7e4f02261efb5a8acbc12d04f052a2f9425
6
+ metadata.gz: 605f1819526e818dd562fa378e3ef014a15ed8c27439f232119329bb73f13d7c4aaf11167823ff8dad4e244573b02f0980d0a448c98061cb38f82e273cb0beeb
7
+ data.tar.gz: eb4f9c23dd0fd4b9cff29c7b12d410b05396227bec18cd81c98acb2354debdc9127414fdebdcd31cc362557347a5d990233f4b05d4e797eed7cf259b9fc4da93
data/README.md CHANGED
@@ -95,6 +95,7 @@ The As Visitor concern do the following tasks for the includer automatically:
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
97
  6. Define the #is_identificated! method as: ``is_identificated!(as: nil, at: Time.now)``
98
+ 7. Define the #is_authenticated! method as: ``is_authenticated!(through: nil, at: Time.now, flag_code: 'RQRD')``
98
99
 
99
100
  ### As Identity concern
100
101
 
@@ -106,6 +107,7 @@ The As Identity concern do the following tasks for the includer automatically:
106
107
 
107
108
  The As Credential concern do the following tasks for the includer automatically:
108
109
  1. Define the has_one :authenticatings macro as: ``has_one :authenticating, class_name: 'Unidom::Visitor::Authenticating', as: :credential``
110
+ 2. Define the #authenticate! method as: ``authenticate!(it, at: Time.now, flag_code: 'RQRD')``
109
111
 
110
112
  ### As Party concern
111
113
 
@@ -6,10 +6,10 @@ 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
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
13
 
14
14
  end
15
15
 
@@ -16,11 +16,15 @@ module Unidom::Visitor::Concerns::AsVisitor
16
16
  identificatings.create! identity: as, opened_at: at
17
17
  end
18
18
 
19
- =begin
20
19
  def is_authenticated!(through: nil, at: Time.now, flag_code: 'RQRD')
21
- authenticatings.create! credential: through, opened_at: at, flag_code: flag_code
20
+ if through.authenticating.present?
21
+ through.authenticating
22
+ else
23
+ authenticatings.create! credential: through, opened_at: at, flag_code: flag_code
24
+ end
22
25
  end
23
26
 
27
+ =begin
24
28
  def cognize!(it, at: Time.now, primary: true)
25
29
  recognizations.create! party: it, elemental: primary, opened_at: at
26
30
  end
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Visitor
3
- VERSION = '1.5'.freeze
3
+ VERSION = '1.6'.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.5'
4
+ version: '1.6'
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-10 00:00:00.000000000 Z
11
+ date: 2016-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common