Method: Annotations::ClassMethods#find_defined_annotation

Defined in:
lib/spiderfw/utils/annotations.rb

#find_defined_annotation(name) ⇒ Object

Searches for a defined annotation in class and ancestors.



185
186
187
188
189
190
191
192
193
# File 'lib/spiderfw/utils/annotations.rb', line 185

def find_defined_annotation(name)
    return nil if self.class == Module && !@defined_annotations
    k = self
    while (k != Object)
        return nil unless k < Annotations
        return k.defined_annotations[name] if k.defined_annotations && k.defined_annotations[name]
        k = k.superclass
    end
end