class OpenStruct
def ==(other)
first_pet == third_pet # => false
first_pet == second_pet # => true
third_pet = OpenStruct.new("name" => "Rowdy", :age => nil)
second_pet = OpenStruct.new(:name => "Rowdy")
first_pet = OpenStruct.new("name" => "Rowdy")
require "ostruct"
equal.
+other+ when +other+ is an OpenStruct and the two objects' Hash tables are
Compares this object and +other+ for equality. An OpenStruct is equal to
def ==(other) return false unless other.kind_of?(OpenStruct) @table == other.table! end