Class: WineBouncer::Configuration
- Inherits:
-
Object
- Object
- WineBouncer::Configuration
- Defined in:
- lib/wine_bouncer/configuration.rb
Instance Attribute Summary collapse
-
#auth_strategy ⇒ Object
Returns the value of attribute auth_strategy.
-
#defined_resource_owner ⇒ Object
Returns the value of attribute defined_resource_owner.
Instance Method Summary collapse
- #define_resource_owner(&block) ⇒ Object
-
#disable(&block) ⇒ Object
when the block evaluates to true, WineBouncer should be disabled if no block is provided, WineBouncer is always enabled.
- #disable_block ⇒ Object
- #require_strategies ⇒ Object
Instance Attribute Details
#auth_strategy ⇒ Object
Returns the value of attribute auth_strategy.
10 11 12 |
# File 'lib/wine_bouncer/configuration.rb', line 10 def auth_strategy @auth_strategy end |
#defined_resource_owner ⇒ Object
Returns the value of attribute defined_resource_owner.
11 12 13 |
# File 'lib/wine_bouncer/configuration.rb', line 11 def defined_resource_owner @defined_resource_owner end |
Instance Method Details
#define_resource_owner(&block) ⇒ Object
22 23 24 25 |
# File 'lib/wine_bouncer/configuration.rb', line 22 def define_resource_owner &block raise(ArgumentError, 'define_resource_owner expects a block in the configuration') unless block_given? @defined_resource_owner = block end |
#disable(&block) ⇒ Object
when the block evaluates to true, WineBouncer should be disabled if no block is provided, WineBouncer is always enabled
34 35 36 |
# File 'lib/wine_bouncer/configuration.rb', line 34 def disable(&block) @disable_block = block end |
#disable_block ⇒ Object
38 39 40 |
# File 'lib/wine_bouncer/configuration.rb', line 38 def disable_block @disable_block || ->() { false } end |
#require_strategies ⇒ Object
18 19 20 |
# File 'lib/wine_bouncer/configuration.rb', line 18 def require_strategies require "wine_bouncer/auth_strategies/#{auth_strategy}" end |