lib/adt/constructor.rb in adts-0.1.0 vs lib/adt/constructor.rb in adts-0.1.1

- old
+ new

@@ -19,9 +19,14 @@ end def ==(other) other.is_a?(self.class) && #{keys.empty? ? "true" : keys.map { |key| "#{key} == other.#{key}"}.join(" && ")} end + + def to_s + self.class.name.split('::').last + '(' + instance_variables.map { |i| i.to_s[1..-1] + ': ' + instance_variable_get(i).inspect }.join(', ') + ')' + end + alias inspect to_s " @parameters = parameters @others = [] end \ No newline at end of file