lib/blather/xmpp_node.rb in blather-0.8.6 vs lib/blather/xmpp_node.rb in blather-0.8.7
- old
+ new
@@ -67,19 +67,23 @@
def self.new(name = registered_name, doc = nil)
super name, doc, BASE_NAMES.include?(name.to_s) ? nil : self.registered_ns
end
def self.decorator_modules
- [self::InstanceMethods]
+ if self.const_defined?(:InstanceMethods)
+ [self::InstanceMethods]
+ else
+ []
+ end
end
def decorate(*decorators)
decorators.each do |decorator|
decorator.decorator_modules.each do |mod|
extend mod
end
- @handler_hierarchy.unshift decorator.handler_hierarchy.first
+ @handler_hierarchy.unshift decorator.handler_hierarchy.first if decorator.respond_to?(:handler_hierarchy)
end
self
end
# Turn the object into a proper stanza