lib/rdf/writer.rb in rdf-0.3.1 vs lib/rdf/writer.rb in rdf-0.3.2
- old
+ new
@@ -279,18 +279,20 @@
end
##
# @param [RDF::Graph] graph
# @return [void] `self`
+ # @deprecated replace by `RDF::Writable#insert_graph`
def write_graph(graph)
graph.each_triple { |*triple| write_triple(*triple) }
self
end
##
# @param [Array<RDF::Statement>] statements
# @return [void] `self`
+ # @deprecated replace by `RDF::Writable#insert_statements`
def write_statements(*statements)
statements.flatten.each { |statement| write_statement(statement) }
self
end
@@ -299,10 +301,11 @@
# @return [void] `self`
def write_statement(statement)
write_triple(*statement.to_triple)
self
end
+ alias_method :insert_statement, :write_statement # support the RDF::Writable interface
##
# @param [Array<Array(RDF::Resource, RDF::URI, RDF::Term)>] triples
# @return [void] `self`
def write_triples(*triples)
@@ -318,14 +321,9 @@
# @raise [NotImplementedError] unless implemented in subclass
# @abstract
def write_triple(subject, predicate, object)
raise NotImplementedError.new("#{self.class}#write_triple") # override in subclasses
end
-
- # Support the RDF::Writable interface:
- alias_method :insert_graph, :write_graph
- alias_method :insert_statements, :write_statements
- alias_method :insert_statement, :write_statement
##
# @param [RDF::Term] term
# @return [String]
# @since 0.3.0