Class: Decidim::DirectVerifications::UserProcessor
- Inherits:
-
Object
- Object
- Decidim::DirectVerifications::UserProcessor
- Defined in:
- lib/decidim/direct_verifications/user_processor.rb
Instance Attribute Summary collapse
-
#authorization_handler ⇒ Object
Returns the value of attribute authorization_handler.
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#emails ⇒ Object
Returns the value of attribute emails.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#processed ⇒ Object
readonly
Returns the value of attribute processed.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
- #authorize_users ⇒ Object
-
#initialize(organization, current_user, session, instrumenter) ⇒ UserProcessor
constructor
A new instance of UserProcessor.
- #register_users ⇒ Object
- #revoke_users ⇒ Object
Constructor Details
#initialize(organization, current_user, session, instrumenter) ⇒ UserProcessor
Returns a new instance of UserProcessor.
11 12 13 14 15 16 17 18 19 |
# File 'lib/decidim/direct_verifications/user_processor.rb', line 11 def initialize(organization, current_user, session, instrumenter) @organization = organization @current_user = current_user @authorization_handler = :direct_verifications @emails = {} @session = session @instrumenter = instrumenter end |
Instance Attribute Details
#authorization_handler ⇒ Object
Returns the value of attribute authorization_handler.
22 23 24 |
# File 'lib/decidim/direct_verifications/user_processor.rb', line 22 def @authorization_handler end |
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
21 22 23 |
# File 'lib/decidim/direct_verifications/user_processor.rb', line 21 def current_user @current_user end |
#emails ⇒ Object
Returns the value of attribute emails.
22 23 24 |
# File 'lib/decidim/direct_verifications/user_processor.rb', line 22 def emails @emails end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
21 22 23 |
# File 'lib/decidim/direct_verifications/user_processor.rb', line 21 def errors @errors end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
21 22 23 |
# File 'lib/decidim/direct_verifications/user_processor.rb', line 21 def organization @organization end |
#processed ⇒ Object (readonly)
Returns the value of attribute processed.
21 22 23 |
# File 'lib/decidim/direct_verifications/user_processor.rb', line 21 def processed @processed end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
21 22 23 |
# File 'lib/decidim/direct_verifications/user_processor.rb', line 21 def session @session end |
Instance Method Details
#authorize_users ⇒ Object
30 31 32 33 34 |
# File 'lib/decidim/direct_verifications/user_processor.rb', line 30 def emails.each do |email, data| AuthorizeUser.new(email, data, session, organization, instrumenter, ).call end end |
#register_users ⇒ Object
24 25 26 27 28 |
# File 'lib/decidim/direct_verifications/user_processor.rb', line 24 def register_users emails.each do |email, data| RegisterUser.new(email, data, organization, current_user, instrumenter).call end end |
#revoke_users ⇒ Object
36 37 38 39 40 |
# File 'lib/decidim/direct_verifications/user_processor.rb', line 36 def revoke_users emails.each do |email, _name| RevokeUser.new(email, organization, instrumenter, ).call end end |