Class: Hydra::Config
- Inherits:
-
Object
- Object
- Hydra::Config
- Defined in:
- lib/hydra/config.rb
Defined Under Namespace
Classes: InheritablePermissionsConfig, PermissionsConfig
Instance Attribute Summary collapse
-
#permissions ⇒ Object
Returns the value of attribute permissions.
-
#user_model ⇒ Object
Returns the value of attribute user_model.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
3 4 5 6 |
# File 'lib/hydra/config.rb', line 3 def initialize @permissions = PermissionsConfig.new @user_model = 'User' end |
Instance Attribute Details
#permissions ⇒ Object
Returns the value of attribute permissions.
30 31 32 |
# File 'lib/hydra/config.rb', line 30 def @permissions end |
#user_model ⇒ Object
Returns the value of attribute user_model.
31 32 33 |
# File 'lib/hydra/config.rb', line 31 def user_model @user_model end |
Instance Method Details
#[](key) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/hydra/config.rb', line 19 def [] key case key when :permissions when :user_model user_model else raise "Unknown key #{key}" end end |
#[]=(key, value) ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/hydra/config.rb', line 8 def []= key, value case key when :permissions self. = value when :user_model self.user_model = value else raise "Unknown key" end end |