Class: SourceMonitor::Configuration::AuthenticationSettings::Handler
- Inherits:
-
Struct
- Object
- Struct
- SourceMonitor::Configuration::AuthenticationSettings::Handler
- Defined in:
- lib/source_monitor/configuration/authentication_settings.rb
Instance Attribute Summary collapse
-
#callable ⇒ Object
Returns the value of attribute callable.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
Instance Attribute Details
#callable ⇒ Object
Returns the value of attribute callable
6 7 8 |
# File 'lib/source_monitor/configuration/authentication_settings.rb', line 6 def callable @callable end |
#type ⇒ Object
Returns the value of attribute type
6 7 8 |
# File 'lib/source_monitor/configuration/authentication_settings.rb', line 6 def type @type end |
Instance Method Details
#call(controller) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/source_monitor/configuration/authentication_settings.rb', line 7 def call(controller) return unless callable case type when :symbol controller.public_send(callable) when :callable arity = callable.arity if arity.zero? controller.instance_exec(&callable) else callable.call(controller) end end end |