Skip to content
Browse files

allow clone_method declarations to end with a !

  • Loading branch information...
1 parent 8647578 commit f2aea26495522bd8e5f833734c855aae3f93561c @ninjudd committed
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/deep_clonable.rb
View
1 lib/deep_clonable.rb
@@ -42,6 +42,7 @@ module ClassMethods
# that part is important) and specify the cloning versions by name
# using this method.
def clone_method(clone_method_name, method_name = nil)
+ clone_method_name = clone_method_name.to_s.gsub(/\!$/,'')
method_name ||= "#{clone_method_name}!"
class_eval %{
def #{clone_method_name}(*args)

0 comments on commit f2aea26

Please sign in to comment.
Something went wrong with that request. Please try again.