lib/redgraph/edge.rb in redgraph-0.1.1 vs lib/redgraph/edge.rb in redgraph-0.1.2

- old
+ new

@@ -2,17 +2,21 @@ module Redgraph class Edge attr_accessor :id, :src, :dest, :type, :properties - def initialize(src:, dest:, type:, properties: {}) + def initialize(src: nil, dest: nil, type: nil, properties: {}) @src = src @dest = dest @type = type @properties = properties end def persisted? !id.nil? + end + + def ==(other) + super || other.instance_of?(self.class) && !id.nil? && other.id == id end end end