Skip to content

Commit

Permalink
Simplify Virtus.included (that case statement made no sense)
Browse files Browse the repository at this point in the history
  • Loading branch information
solnic committed Jun 8, 2012
1 parent 3615ab4 commit 15ad0b5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/virtus.rb
Expand Up @@ -25,11 +25,10 @@ module Virtus
# @api private # @api private
def self.included(object) def self.included(object)
super super
case object if Class === object
when Class then object.send(:include, ClassInclusions) object.send(:include, ClassInclusions)
when Module then object.extend(ModuleExtensions)
else else
raise ArgumentError, "Object not supported #{object.inspect}" object.extend(ModuleExtensions)
end end
end end
private_class_method :included private_class_method :included
Expand Down

0 comments on commit 15ad0b5

Please sign in to comment.