Class: AuthorizeRbac::Configuration
- Inherits:
-
Object
- Object
- AuthorizeRbac::Configuration
- Defined in:
- lib/authorize_rbac/configuration.rb
Defined Under Namespace
Classes: InvalidKey
Constant Summary collapse
- CONFIG_KEYS =
[ :current_user_method, :default_controller, :default_action ]
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 |
# File 'lib/authorize_rbac/configuration.rb', line 10 def initialize @configs = {} end |
Instance Method Details
#[](key) ⇒ Object
20 21 22 |
# File 'lib/authorize_rbac/configuration.rb', line 20 def [](key) @configs[key] end |
#[]=(key, value) ⇒ Object
14 15 16 17 18 |
# File 'lib/authorize_rbac/configuration.rb', line 14 def []=(key, value) raise InvalidKey, key unless CONFIG_KEYS.include?(key) @configs[key] = value end |