Sha256: dca2bdb512704fdefa301a66b1461fd097bfaf07f929d4b28c22ae873d2b613f

Contents?: true

Size: 435 Bytes

Versions: 8

Compression:

Stored size: 435 Bytes

Contents

module IqRdf
  class Literal
    class URI < Literal

      def initialize(uri)
        raise "#{uri.inspect} is not an URI" unless uri.is_a?(::URI)
        super(uri)
      end

      def to_s(parent_lang = nil)
        "<#{@obj.to_s}>"
      end

      def to_ntriples(parent_lang = nil)
        "<#{@obj.to_s}>"
      end

      def build_xml(xml, &block)
        block.call("rdf:resource" => @obj.to_s)
      end

    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
iq_rdf-0.1.17 lib/iq_rdf/literal/uri.rb
iq_rdf-0.1.16 lib/iq_rdf/literal/uri.rb
iq_rdf-0.1.15 lib/iq_rdf/literal/uri.rb
iq_rdf-0.1.14 lib/iq_rdf/literal/uri.rb
iq_rdf-0.1.13 lib/iq_rdf/literal/uri.rb
iq_rdf-0.1.12 lib/iq_rdf/literal/uri.rb
iq_rdf-0.1.10 lib/iq_rdf/literal/uri.rb
iq_rdf-0.1.8 lib/iq_rdf/literal/uri.rb