From: Matthew King Date: Tue, 27 Nov 2007 20:39:30 +0000 (-0600) Subject: Playing with pattern matching via === X-Git-Url: https://repo.or.cz/monoslider.git/commitdiff_plain/HEAD Playing with pattern matching via === --- diff --git a/lib/array_case_equality.rb b/lib/array_case_equality.rb index 06f7714..3595768 100644 --- a/lib/array_case_equality.rb +++ b/lib/array_case_equality.rb @@ -1,8 +1,8 @@ class Array - alias :case_equal? :=== + alias_method :case_equal?, :=== - def ===(other, counter = [0], my_rec = {}, his_rec = {}) # !> method redefined; discarding old eql? + def ===(other, counter = [0], my_rec = {}, his_rec = {}) # !> method redefined; discarding old === return true if other.object_id == self.object_id return false unless other.is_a? Array return true if other == self diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 839d792..162a5ce 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,6 @@ require File.dirname(__FILE__) + '/../../../../spec/spec_helper' + plugin_spec_dir = File.dirname(__FILE__) # ActiveRecord::Base.logger = Logger.new(plugin_spec_dir + "/debug.log")