Sha256: 1dcf042c3970cbddca55f161a657aa0ad9cc05faea2c18b27559414ee254b1bd

Contents?: true

Size: 615 Bytes

Versions: 127

Compression:

Stored size: 615 Bytes

Contents

module RDF
  ##
  # An RDF resource.
  module Resource
    include RDF::Term

    ##
    # Instantiates an {RDF::Node} or an {RDF::URI}, depending on the given
    # argument.
    #
    # @return [RDF::Resource]
    def self.new(*args, &block)
      case arg = args.shift
        when Symbol     then Node.intern(arg, *args, &block)
        when /^_:(.*)$/ then Node.new($1, *args, &block)
        else URI.new(arg, *args, &block)
      end
    end

    ##
    # Returns `true` to indicate that this value is a resource.
    #
    # @return [Boolean]
    def resource?
      true
    end
  end # Resource
end # RDF

Version data entries

127 entries across 127 versions & 2 rubygems

Version Path
rdf-1.1.5.1 lib/rdf/model/resource.rb
rdf-1.1.5 lib/rdf/model/resource.rb
rdf-1.1.4.3 lib/rdf/model/resource.rb
rdf-1.1.4.2 lib/rdf/model/resource.rb
rdf-1.1.4.1 lib/rdf/model/resource.rb
rdf-1.1.4 lib/rdf/model/resource.rb
rdf-1.1.3 lib/rdf/model/resource.rb
rdf-1.1.2.1 lib/rdf/model/resource.rb
rdf-1.1.1.1 lib/rdf/model/resource.rb
rdf-1.1.1 lib/rdf/model/resource.rb
rdf-1.1.0.1 lib/rdf/model/resource.rb
rdf-1.1.0 lib/rdf/model/resource.rb
rdf-1.0.10.2 lib/rdf/model/resource.rb
rdf-1.0.10.1 lib/rdf/model/resource.rb
rdf-1.1.0p4 lib/rdf/model/resource.rb
rdf-1.0.10 lib/rdf/model/resource.rb
rdf-1.0.9 lib/rdf/model/resource.rb
rdf-1.0.8 lib/rdf/model/resource.rb
rdf-1.1.0.p3 lib/rdf/model/resource.rb
rdf-1.0.7 lib/rdf/model/resource.rb