Sha256: 3a0d81805e5a985719585763942791111b30d257dd99d3ecb1992b09af3f3c56

Contents?: true

Size: 378 Bytes

Versions: 6

Compression:

Stored size: 378 Bytes

Contents

module Volt
  class Location
    def host
      if RUBY_PLATFORM == 'opal'
        `document.location.host`
      else
        Volt.config.domain
      end
    end

    def protocol
      scheme + ':'
    end

    def scheme
      if RUBY_PLATFORM == 'opal'
        `document.location.protocol`[0..-2]
      else
        Volt.config.scheme || 'http'
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
volt-0.9.7.pre8 lib/volt/models/location.rb
volt-0.9.7.pre7 lib/volt/models/location.rb
volt-0.9.7.pre6 lib/volt/models/location.rb
volt-0.9.7.pre5 lib/volt/models/location.rb
volt-0.9.7.pre3 lib/volt/models/location.rb
volt-0.9.7.pre2 lib/volt/models/location.rb