mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
17 lines
No EOL
296 B
Ruby
17 lines
No EOL
296 B
Ruby
class Class
|
|
def abstract(*methods)
|
|
methods.each do |method|
|
|
define_method method do
|
|
raise NotImplementedError
|
|
end
|
|
end
|
|
end
|
|
|
|
def hash_on(delegatee)
|
|
define_method :eql? do |other|
|
|
self == other
|
|
end
|
|
|
|
delegate :hash, :to => delegatee
|
|
end
|
|
end |