Class: MrMime::ImpersonationPolicy
- Inherits:
-
Object
- Object
- MrMime::ImpersonationPolicy
- Defined in:
- app/models/mr_mime/impersonation_policy.rb
Instance Attribute Summary collapse
-
#impersonated ⇒ Object
readonly
Returns the value of attribute impersonated.
-
#impersonator ⇒ Object
readonly
Returns the value of attribute impersonator.
Class Method Summary collapse
Instance Method Summary collapse
- #allowed? ⇒ Boolean
-
#initialize(impersonator, impersonated) ⇒ ImpersonationPolicy
constructor
A new instance of ImpersonationPolicy.
Constructor Details
#initialize(impersonator, impersonated) ⇒ ImpersonationPolicy
Returns a new instance of ImpersonationPolicy.
11 12 13 14 |
# File 'app/models/mr_mime/impersonation_policy.rb', line 11 def initialize(impersonator, impersonated) @impersonator = impersonator @impersonated = impersonated end |
Instance Attribute Details
#impersonated ⇒ Object (readonly)
Returns the value of attribute impersonated.
5 6 7 |
# File 'app/models/mr_mime/impersonation_policy.rb', line 5 def impersonated @impersonated end |
#impersonator ⇒ Object (readonly)
Returns the value of attribute impersonator.
5 6 7 |
# File 'app/models/mr_mime/impersonation_policy.rb', line 5 def impersonator @impersonator end |
Class Method Details
.allowed?(*args) ⇒ Boolean
7 8 9 |
# File 'app/models/mr_mime/impersonation_policy.rb', line 7 def self.allowed?(*args) new(*args).allowed? end |
Instance Method Details
#allowed? ⇒ Boolean
16 17 18 19 20 |
# File 'app/models/mr_mime/impersonation_policy.rb', line 16 def allowed? return true unless impersonator.public_send() end |