lib/wine_bouncer/configuration.rb in wine_bouncer-1.0.1 vs lib/wine_bouncer/configuration.rb in wine_bouncer-1.0.2
- old
+ new
@@ -18,16 +18,16 @@
def require_strategies
require "wine_bouncer/auth_strategies/#{auth_strategy}"
end
def define_resource_owner &block
- fail(ArgumentError, 'define_resource_owner expects a block in the configuration') unless block_given?
+ raise(ArgumentError, 'define_resource_owner expects a block in the configuration') unless block_given?
@defined_resource_owner = block
end
def defined_resource_owner
- fail(Errors::UnconfiguredError, 'Please define define_resource_owner to configure the resource owner') unless @defined_resource_owner
+ raise(Errors::UnconfiguredError, 'Please define define_resource_owner to configure the resource owner') unless @defined_resource_owner
@defined_resource_owner
end
# when the block evaluates to true, WineBouncer should be disabled
# if no block is provided, WineBouncer is always enabled
@@ -39,11 +39,11 @@
@disable_block || ->() { false }
end
end
def self.configuration
- @configuration || fail(Errors::UnconfiguredError.new)
+ @configuration || raise(Errors::UnconfiguredError.new)
end
def self.configuration=(config)
@configuration = config
@configuration.require_strategies
@@ -57,10 +57,10 @@
yield(config)
config.require_strategies
config
end
- private
+ private_class_method
###
# Returns a new configuration or existing one.
###
def self.config