Sha256: 551ad3afb047f717093d9191fc264637f9f922f11dabe238a6f0cb7fdc1d5af6

Contents?: true

Size: 779 Bytes

Versions: 12

Compression:

Stored size: 779 Bytes

Contents

module Browser
  class Location
    if RUBY_ENGINE == 'opal'
      include DelegateNative
    else
      def initialize(location_string)
        @location = URI(location_string)
      rescue
        @location = URI('http://localhost/')
      end

      def hash
        @location.hash
      end

      def host
        @location.host
      end

      def hostname
        @location.hostname
      end

      def href
        @location.to_s
      end

      def origin
        @location.origin
      end

      def pathname
        @location.path
      end

      def port
        @location.port
      end

      def protocol
        @location.scheme
      end

      def search
        @location.query
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
isomorfeus-preact-23.9.0.rc12 lib/browser/location.rb
isomorfeus-preact-23.9.0.rc11 lib/browser/location.rb
isomorfeus-preact-23.9.0.rc10 lib/browser/location.rb
isomorfeus-preact-23.9.0.rc9 lib/browser/location.rb
isomorfeus-preact-23.9.0.rc8 lib/browser/location.rb
isomorfeus-preact-23.9.0.rc7 lib/browser/location.rb
isomorfeus-preact-23.9.0.rc6 lib/browser/location.rb
isomorfeus-preact-23.9.0.rc5 lib/browser/location.rb
isomorfeus-preact-23.9.0.rc4 lib/browser/location.rb
isomorfeus-preact-23.9.0.rc3 lib/browser/location.rb
isomorfeus-preact-23.9.0.rc2 lib/browser/location.rb
isomorfeus-preact-23.9.0.rc1 lib/browser/location.rb