lib/roxml/xml/references.rb in roxml-2.5.1 vs lib/roxml/xml/references.rb in roxml-2.5.2
- old
+ new
@@ -46,11 +46,12 @@
private
attr_reader :opts
def conventionize(what)
- if !what.blank? && @instance.try(:class).try(:roxml_naming_convention).respond_to?(:call)
- URI.unescape(@instance.class.roxml_naming_convention.call(URI.escape(what, /\/|::/)))
+ convention ||= @instance.class.respond_to?(:roxml_naming_convention) && @instance.class.roxml_naming_convention
+ if !what.blank? && convention.respond_to?(:call)
+ URI.unescape(convention.call(URI.escape(what, /\/|::/)))
else
what
end
end
\ No newline at end of file