lib/mida/item.rb in mida-0.3.1 vs lib/mida/item.rb in mida-0.3.2
- old
+ new
@@ -138,13 +138,11 @@
end
# Returns whether the +itemtype+ is a valid type
def valid_itemtype?(valid_types, itemtype)
return true if valid_types.include?(:any)
-
- valid_types.find do |type|
- type.respond_to?(:itemtype) && type.itemtype =~ itemtype
- end
+ vocabulary = Vocabulary.find(itemtype)
+ valid_types.find {|type| vocabulary.kind_of?(type) }
end
# Returns the extracted value or +nil+ if none of the datatypes
# could extract the +value+
def datatype_extract(valid_types, value)