Sha256: 294621db8deeb1fcb92419b023370d782187b71ca77438642c88aa5ef1e28118

Contents?: true

Size: 1008 Bytes

Versions: 16

Compression:

Stored size: 1008 Bytes

Contents

module Adhearsion
  module VoIP
    module DSL
      class DialingDSL
        module MonkeyPatches
          module RegexpMonkeyPatch
            
            def |(other)
              case other
                when RouteRule
                  other.unshift_pattern self
                  other
                when Regexp
                  RouteRule.new :patterns => [self, other]
                else
                  raise ArgumentError, "Unsupported pattern type #{other.inspect}"
              end
            end

            def >>(other)
              case other
                when ProviderDefinition
                  RouteRule.new :patterns => self, :providers => other
                when RouteRule
                  returning other do |route|
                    route.unshift_pattern self
                  end
                else raise ArgumentError, "Unsupported route definition #{other.inspect}"
              end
            end

          end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 7 rubygems

Version Path
eric-adhearsion-0.7.999 lib/adhearsion/voip/dsl/dialing_dsl/dialing_dsl_monkey_patches.rb
eric-adhearsion-0.8.0 lib/adhearsion/voip/dsl/dialing_dsl/dialing_dsl_monkey_patches.rb
jicksta-adhearsion-0.7.999 lib/adhearsion/voip/dsl/dialing_dsl/dialing_dsl_monkey_patches.rb
jicksta-adhearsion-0.8.0 lib/adhearsion/voip/dsl/dialing_dsl/dialing_dsl_monkey_patches.rb
jicksta-adhearsion-0.8.2 lib/adhearsion/voip/dsl/dialing_dsl/dialing_dsl_monkey_patches.rb
jicksta-adhearsion-0.8.3 lib/adhearsion/voip/dsl/dialing_dsl/dialing_dsl_monkey_patches.rb
kenwiesner-adhearsioncw-0.8.3 lib/adhearsion/voip/dsl/dialing_dsl/dialing_dsl_monkey_patches.rb
mtrudel-adhearsion-0.8.3 lib/adhearsion/voip/dsl/dialing_dsl/dialing_dsl_monkey_patches.rb
sant0sk1-adhearsion-0.7.999 lib/adhearsion/voip/dsl/dialing_dsl/dialing_dsl_monkey_patches.rb
sevenscale-adhearsion-0.7.1000 lib/adhearsion/voip/dsl/dialing_dsl/dialing_dsl_monkey_patches.rb
sevenscale-adhearsion-0.7.1003 lib/adhearsion/voip/dsl/dialing_dsl/dialing_dsl_monkey_patches.rb
sevenscale-adhearsion-0.8.0 lib/adhearsion/voip/dsl/dialing_dsl/dialing_dsl_monkey_patches.rb
adhearsion-0.8.3 lib/adhearsion/voip/dsl/dialing_dsl/dialing_dsl_monkey_patches.rb
adhearsion-0.8.1 lib/adhearsion/voip/dsl/dialing_dsl/dialing_dsl_monkey_patches.rb
adhearsion-0.8.2 lib/adhearsion/voip/dsl/dialing_dsl/dialing_dsl_monkey_patches.rb
adhearsion-0.8.0 lib/adhearsion/voip/dsl/dialing_dsl/dialing_dsl_monkey_patches.rb