Class: Adhearsion::DialPlan::Loader::ContextNameCollector
- Defined in:
- lib/adhearsion/voip/dial_plan.rb
Overview
< ::BlankSlate
Instance Attribute Summary collapse
-
#contexts ⇒ Object
readonly
Returns the value of attribute contexts.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ ContextNameCollector
constructor
A new instance of ContextNameCollector.
- #method_missing(name, *args, &block) ⇒ Object
Constructor Details
#initialize ⇒ ContextNameCollector
Returns a new instance of ContextNameCollector.
211 212 213 |
# File 'lib/adhearsion/voip/dial_plan.rb', line 211 def initialize @contexts = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
215 216 217 218 |
# File 'lib/adhearsion/voip/dial_plan.rb', line 215 def method_missing(name, *args, &block) super if !block_given? || args.any? contexts[name] = DialplanContextProc.new(name, &block) end |
Instance Attribute Details
#contexts ⇒ Object (readonly)
Returns the value of attribute contexts.
210 211 212 |
# File 'lib/adhearsion/voip/dial_plan.rb', line 210 def contexts @contexts end |
Class Method Details
.const_missing(name) ⇒ Object
202 203 204 205 206 |
# File 'lib/adhearsion/voip/dial_plan.rb', line 202 def const_missing(name) super rescue ArgumentError raise NameError, %(undefined constant "#{name}") end |