Sha256: 664370f510d788c6e9088248e202c8f971382c56422e6985a0a6d931f540d73d
Contents?: true
Size: 474 Bytes
Versions: 9
Compression:
Stored size: 474 Bytes
Contents
module ValueEquals def ==(other) return false unless instance_variables.size == other.instance_variables.size instance_variables.all? {|var| self.instance_variable_get(var) == other.instance_variable_get(var)} end end class Movie include ValueEquals attr_accessor :title, :director, :writers end class Director include ValueEquals attr_accessor :name, :awards end class AcademyAward include ValueEquals attr_accessor :year, :category end
Version data entries
9 entries across 9 versions & 2 rubygems