Sha256: f677e653ab090797f6f4a8d4c31951c69da294810dbd123f2f2eebc8cdc48e8e

Contents?: true

Size: 654 Bytes

Versions: 1

Compression:

Stored size: 654 Bytes

Contents

module DiviningRod
  class Matchers
    class << self

      def ua(pattern, opts = {})
        Definition.new(opts) { |request|
          if pattern.match(request.env['HTTP_USER_AGENT'])
            true
          end
        }
      end

      def subdomain(pattern, opts={})
        Definition.new(opts) { |request|
          if pattern.match(DiviningRod::Utilities.parse_subdomain(request)[0])
            true
          end
        }
      end

      def ua_prof(pattern, opts ={})
        Definition.new(opts) {|request|
          if pattern.match(request.env['X_WAP_PROFILE'])
            true
          end
        }
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
divining_rod-0.5.0 lib/divining_rod/matchers.rb