Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Simplify Virtus.included (that case statement made no sense)

  • Loading branch information...
commit 15ad0b550b744f786d8345c075161bc51b7d135e 1 parent 3615ab4
@solnic authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 lib/virtus.rb
View
7 lib/virtus.rb
@@ -25,11 +25,10 @@ module Virtus
# @api private
def self.included(object)
super
- case object
- when Class then object.send(:include, ClassInclusions)
- when Module then object.extend(ModuleExtensions)
+ if Class === object
+ object.send(:include, ClassInclusions)
else
- raise ArgumentError, "Object not supported #{object.inspect}"
+ object.extend(ModuleExtensions)
end
end
private_class_method :included
Please sign in to comment.
Something went wrong with that request. Please try again.