Permalink
Browse files

update primitive to support classes which are subclasses of primitives

  • Loading branch information...
1 parent 5548935 commit 2fbf106e81093d57c84869b3f21daf31494f1133 @mvanholstyn mvanholstyn committed Jan 26, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/happymapper/item.rb
View
@@ -66,7 +66,13 @@ def xpath(namespace = self.namespace)
end
def primitive?
- Types.include?(constant)
+ classes = []
+ clazz = constant
+ while clazz
+ classes << clazz
+ clazz = clazz.superclass
+ end
+ classes.detect { |c| Types.include?(c) }
end
def element?

0 comments on commit 2fbf106

Please sign in to comment.