Class: Roda::RodaPlugins::BasicRestfulAction::Config
- Defined in:
- lib/zleb/plugins/basic_restful_action.rb
Instance Method Summary collapse
- #[](name) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #method_missing(meth, *args, &block) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
25 26 27 |
# File 'lib/zleb/plugins/basic_restful_action.rb', line 25 def initialize() @config = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &block) ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/zleb/plugins/basic_restful_action.rb', line 33 def method_missing(meth, *args, &block) if meth =~ /(\w+)=$/ @config[$1.to_sym] = args[0] else if block @config[meth] = block end end end |
Instance Method Details
#[](name) ⇒ Object
29 30 31 |
# File 'lib/zleb/plugins/basic_restful_action.rb', line 29 def [](name) @config[name] end |