Module: Rolify::Configure
- Included in:
- Rolify
- Defined in:
- lib/rolify/configure.rb
Constant Summary collapse
- @@dynamic_shortcuts =
false
- @@orm =
"active_record"
Instance Method Summary collapse
- #configure(*role_cnames) {|_self| ... } ⇒ Object
- #dynamic_shortcuts ⇒ Object
- #dynamic_shortcuts=(is_dynamic) ⇒ Object
- #orm ⇒ Object
- #orm=(orm) ⇒ Object
- #use_defaults ⇒ Object
- #use_dynamic_shortcuts ⇒ Object
- #use_mongoid ⇒ Object
Instance Method Details
#configure(*role_cnames) {|_self| ... } ⇒ Object
6 7 8 9 |
# File 'lib/rolify/configure.rb', line 6 def configure(*role_cnames) return if !sanity_check(role_cnames) yield self if block_given? end |
#dynamic_shortcuts ⇒ Object
11 12 13 |
# File 'lib/rolify/configure.rb', line 11 def dynamic_shortcuts @@dynamic_shortcuts end |
#dynamic_shortcuts=(is_dynamic) ⇒ Object
15 16 17 |
# File 'lib/rolify/configure.rb', line 15 def dynamic_shortcuts=(is_dynamic) @@dynamic_shortcuts = is_dynamic end |
#orm ⇒ Object
19 20 21 |
# File 'lib/rolify/configure.rb', line 19 def orm @@orm end |
#orm=(orm) ⇒ Object
23 24 25 |
# File 'lib/rolify/configure.rb', line 23 def orm=(orm) @@orm = orm end |
#use_defaults ⇒ Object
35 36 37 38 39 40 |
# File 'lib/rolify/configure.rb', line 35 def use_defaults configure do |config| config.dynamic_shortcuts = false config.orm = "active_record" end end |
#use_dynamic_shortcuts ⇒ Object
31 32 33 |
# File 'lib/rolify/configure.rb', line 31 def use_dynamic_shortcuts self.dynamic_shortcuts = true end |
#use_mongoid ⇒ Object
27 28 29 |
# File 'lib/rolify/configure.rb', line 27 def use_mongoid self.orm = "mongoid" end |