diff options
-rw-r--r-- | lib/arel/algebra/core_extensions.rb | 1 | ||||
-rw-r--r-- | lib/arel/algebra/core_extensions/class.rb | 32 |
2 files changed, 0 insertions, 33 deletions
diff --git a/lib/arel/algebra/core_extensions.rb b/lib/arel/algebra/core_extensions.rb index bce86d04ba..4416ff6b77 100644 --- a/lib/arel/algebra/core_extensions.rb +++ b/lib/arel/algebra/core_extensions.rb @@ -1,4 +1,3 @@ require 'arel/algebra/core_extensions/object' -require 'arel/algebra/core_extensions/class' require 'arel/algebra/core_extensions/symbol' require 'arel/algebra/core_extensions/hash' diff --git a/lib/arel/algebra/core_extensions/class.rb b/lib/arel/algebra/core_extensions/class.rb deleted file mode 100644 index d0894931da..0000000000 --- a/lib/arel/algebra/core_extensions/class.rb +++ /dev/null @@ -1,32 +0,0 @@ -module Arel - module ClassExtensions - def attributes(*attrs) - @attributes = attrs - attr_reader(*attrs) - end - - def deriving(*methods) - methods.each { |m| derive m } - end - - def derive(method_name) - methods = { - :initialize => " - def #{method_name}(#{@attributes.join(',')}) - #{@attributes.collect { |a| "@#{a} = #{a}" }.join("\n")} - end - ", - :== => " - def ==(other) - #{name} === other && - #{@attributes.collect { |a| "@#{a} == other.#{a}" }.join(" &&\n")} - end - " - } - class_eval methods[method_name], __FILE__, __LINE__ - end - - Class.send(:include, self) - end -end - |