lib/rdf/isomorphic.rb in rdf-isomorphic-3.0.0 vs lib/rdf/isomorphic.rb in rdf-isomorphic-3.1.0

- old
+ new

@@ -24,12 +24,12 @@ # @param opts [Hash<Symbol => Any>] options # @param other [RDF::Enumerable] # @return [Boolean] # @example # repository_a.isomorphic_with repository_b #=> true - def isomorphic_with?(other, opts = {}) - !(bijection_to(other, opts).nil?) + def isomorphic_with?(other, **opts) + !(bijection_to(other, **opts).nil?) end alias_method :isomorphic?, :isomorphic_with? @@ -45,11 +45,11 @@ # @example # repository_a.bijection_to repository_b # @param other [RDF::Enumerable] # @param opts [Hash<Symbol => Any>] options # @return [Hash, nil] - def bijection_to(other, opts = {}) + def bijection_to(other, **opts) grounded_stmts_match = (count == other.count) grounded_stmts_match &&= each_statement.all? do | stmt | stmt.node? || other.has_statement?(stmt) @@ -63,11 +63,11 @@ blank_stmts = find_all { |statement| statement.node? } other_blank_stmts = other.find_all { |statement| statement.node? } nodes = RDF::Isomorphic.blank_nodes_in(blank_stmts) other_nodes = RDF::Isomorphic.blank_nodes_in(other_blank_stmts) - build_bijection_to blank_stmts, nodes, other_blank_stmts, other_nodes, {}, {}, opts + build_bijection_to blank_stmts, nodes, other_blank_stmts, other_nodes, {}, {}, **opts else nil end end @@ -89,10 +89,10 @@ # @param [Hash] these_grounded_hashes # @param [Hash] other_grounded_hashes # @param [Hash] opts # @return [nil,Hash] # @private - def build_bijection_to(anon_stmts, nodes, other_anon_stmts, other_nodes, these_grounded_hashes = {}, other_grounded_hashes = {}, opts = {}) + def build_bijection_to(anon_stmts, nodes, other_anon_stmts, other_nodes, these_grounded_hashes = {}, other_grounded_hashes = {}, **opts) # Create a hash signature of every node, based on the signature of # statements it exists in. # We also save hashes of nodes that cannot be reliably known; we will use # that information to eliminate possible recursion combinations.