Class: Adhearsion::VoIP::DSL::DialingDSL

Inherits:
Object
  • Object
show all
Extended by:
Conveniences
Includes:
Constants
Defined in:
lib/adhearsion/voip/dsl/dialing_dsl.rb,
lib/adhearsion/voip/dsl/dialing_dsl/dialing_dsl_monkey_patches.rb

Defined Under Namespace

Modules: MonkeyPatches Classes: ProviderDefinition, RouteRule

Constant Summary

Constants included from Constants

Constants::ISN, Constants::Q931_TYPE_OF_NUMBER, Constants::SIP_URI, Constants::US_LOCAL_NUMBER, Constants::US_NATIONAL_NUMBER

Class Method Summary collapse

Methods included from Conveniences

_

Class Method Details

.calculate_routes_for(destination) ⇒ Object



44
45
46
47
# File 'lib/adhearsion/voip/dsl/dialing_dsl.rb', line 44

def self.calculate_routes_for(destination)
  destination = destination.to_s
  routes.select { |defined_route| defined_route === destination }.map &:providers
end

.inherited(klass) ⇒ Object



35
36
37
38
39
40
41
42
# File 'lib/adhearsion/voip/dsl/dialing_dsl.rb', line 35

def self.inherited(klass)
  klass.class_eval do
    [:@@providers, :@@routes].each do |var|
      class_variable_set(var, [])
      cattr_reader var.to_s.gsub('@@', '')
    end
  end
end