Class: Logux::PolicyCaller
- Inherits:
-
Object
- Object
- Logux::PolicyCaller
- Extended by:
- Forwardable
- Defined in:
- lib/logux/policy_caller.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
Instance Method Summary collapse
- #call! ⇒ Object
-
#initialize(action:, meta:) ⇒ PolicyCaller
constructor
A new instance of PolicyCaller.
Constructor Details
#initialize(action:, meta:) ⇒ PolicyCaller
Returns a new instance of PolicyCaller.
11 12 13 14 |
# File 'lib/logux/policy_caller.rb', line 11 def initialize(action:, meta:) @action = action @meta = end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
7 8 9 |
# File 'lib/logux/policy_caller.rb', line 7 def action @action end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
7 8 9 |
# File 'lib/logux/policy_caller.rb', line 7 def @meta end |
Instance Method Details
#call! ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/logux/policy_caller.rb', line 16 def call! logger.debug('Searching policy for Logux action:' \ " #{action}, meta: #{}") policy.public_send("#{action.action_type}?") rescue Logux::UnknownActionError, Logux::UnknownChannelError => e raise e if configuration. logger.warn(e) end |