Sha256: 900ea8c7cbe98664912358366e742403d079df07f02d56ebd9df0393bb89d164
Contents?: true
Size: 1.15 KB
Versions: 2
Compression:
Stored size: 1.15 KB
Contents
require 'addressable/uri' module RDF ## # A Uniform Resource Identifier (URI). class URI < Node ## # @param [String] uri # @return [URI] def self.parse(uri) self.new(uri) end ## # @param [URI, String, #to_s] uri def initialize(uri) @uri = case uri when Addressable::URI then uri else Addressable::URI.parse(uri.to_s) end end ## # @return [Boolean] def anonymous? false end ## # @param [URI] other # @return [Boolean] def eql?(other) other.is_a?(URI) && self == other end ## # @param [Object] other # @return [Boolean] def ==(other) other.respond_to?(:to_uri) && @uri == other.to_uri end ## # @return [URI] def to_uri @uri end ## # @return [String] def to_s @uri.to_s end protected def respond_to?(symbol) #:nodoc: @uri.respond_to?(symbol) || super end def method_missing(symbol, *args, &block) #:nodoc: if @uri.respond_to?(symbol) @uri.send(symbol, *args, &block) else super end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rdf-0.0.5 | lib/rdf/uri.rb |
rdf-0.0.4 | lib/rdf/uri.rb |