Module: PseudoKiosk::Config
- Defined in:
- lib/pseudo_kiosk/config.rb
Class Attribute Summary collapse
-
.unlock_mechanism ⇒ Object
accepts a lambda function or string if lambda function is passed, instance of controller is passed to lambda for access to helper functions like current_user.
Class Method Summary collapse
- .configure(&blk) ⇒ Object
- .configure! ⇒ Object
- .init! ⇒ Object
-
.reset! ⇒ Object
Resets all configuration options to their default values.
Class Attribute Details
.unlock_mechanism ⇒ Object
accepts a lambda function or string if lambda function is passed, instance of controller is passed to lambda for access to helper functions like current_user
8 9 10 |
# File 'lib/pseudo_kiosk/config.rb', line 8 def unlock_mechanism @unlock_mechanism end |
Class Method Details
.configure(&blk) ⇒ Object
23 24 25 26 |
# File 'lib/pseudo_kiosk/config.rb', line 23 def configure(&blk) @configure_blk = blk configure! end |
.configure! ⇒ Object
28 29 30 |
# File 'lib/pseudo_kiosk/config.rb', line 28 def configure! @configure_blk.call(self) if @configure_blk end |
.init! ⇒ Object
10 11 12 13 14 |
# File 'lib/pseudo_kiosk/config.rb', line 10 def init! @defaults = { :@unlock_mechanism => nil, } end |
.reset! ⇒ Object
Resets all configuration options to their default values.
17 18 19 20 21 |
# File 'lib/pseudo_kiosk/config.rb', line 17 def reset! @defaults.each do |k, v| instance_variable_set(k, v) end end |