Sha256: efa1f29c16a42c158329738365512df1dfac3c13cac76bd37efe3823491f60c6

Contents?: true

Size: 680 Bytes

Versions: 3

Compression:

Stored size: 680 Bytes

Contents

require 'rdf'
# override several inspect functions to improve output for what we're doing

class RDF::Literal
  def inspect
    "\"#{escape(value)}\" R:L:(#{self.class.to_s.match(/([^:]*)$/)})"
  end
end

class RDF::URI
  def inspect
    "RDF::URI(#{to_base})"
  end
end

class RDF::Node
  def inspect
    "RDF::Node(#{to_base})"
  end
end

class RDF::Graph
  def inspect
    "RDF::Graph(graph_name: #{self.graph_name || 'nil'})"
  end
end

class RDF::Query
  def inspect
    "RDF::Query(#{graph_name ? graph_name.to_sxp : 'nil'})#{patterns.inspect}"
  end
end

class RDF::Query::Solutions
  def inspect
    string = "vars: #{variable_names.join(",")}\n#{to_a.inspect}"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rdf-spec-3.1.2 lib/rdf/spec/inspects.rb
rdf-spec-3.1.1 lib/rdf/spec/inspects.rb
rdf-spec-3.1.0 lib/rdf/spec/inspects.rb