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-3.2.12 lib/rdf/model/resource.rb
rdf-3.3.2 lib/rdf/model/resource.rb
rdf-3.3.1 lib/rdf/model/resource.rb
rdf-3.3.0 lib/rdf/model/resource.rb
rdf-3.2.11 lib/rdf/model/resource.rb
rdf-3.2.10 lib/rdf/model/resource.rb
rdf-3.2.9 lib/rdf/model/resource.rb
rdf-3.2.8 lib/rdf/model/resource.rb
rdf-3.2.7 lib/rdf/model/resource.rb
rdf-3.2.6 lib/rdf/model/resource.rb
rdf-3.2.5 lib/rdf/model/resource.rb
rdf-3.2.4 lib/rdf/model/resource.rb
rdf-3.2.3 lib/rdf/model/resource.rb
rdf-3.2.2 lib/rdf/model/resource.rb
rdf-3.2.1 lib/rdf/model/resource.rb
rdf-3.1.15 lib/rdf/model/resource.rb
rdf-3.1.13 lib/rdf/model/resource.rb
rdf-3.1.12 lib/rdf/model/resource.rb
rdf-3.1.11 lib/rdf/model/resource.rb
rdf-3.1.10 lib/rdf/model/resource.rb