InvalidPropertyPrefix error class
Raise a InvalidPropertyPrefix error if the prefix is invalid.
This commit is contained in:
parent
e8be12b66e
commit
e8d9e77e41
3 changed files with 12 additions and 3 deletions
|
@ -33,4 +33,7 @@ module Microformats2
|
|||
html
|
||||
end
|
||||
end # class << self
|
||||
|
||||
class InvalidPropertyPrefix < StandardError; end
|
||||
|
||||
end
|
||||
|
|
|
@ -37,6 +37,7 @@ module Microformats2
|
|||
prefix = property_class.split("-").first
|
||||
# find ruby class for kind of property
|
||||
klass = Microformats2::Property::PREFIX_CLASS_MAP[prefix]
|
||||
raise InvalidPropertyPrefix unless klass
|
||||
# We don't have a nokogiri element so pass in nil
|
||||
property = klass.new(nil, property_class, value)
|
||||
assign_property(property)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue