lib/swagger_yard.rb
# Validates that the tag has non-nil values for the given attribute methods.
# Logs a warning message and returns nil if the tag is not valid.
Validates that the tag has non-nil values for the given attribute methods.
Logs a warning message and returns nil if the tag is not valid.
Validates that the tag has non - nil values for the given attribute methods . Logs a warning message and returns nil if the tag is not valid .
def requires_attrs(tag, *attrs)
      valid = true
      attrs.each do |a|
        valid &&= tag.send(a)
        break unless valid
      end
      unless valid
        if tag.object
          object   = " in #{tag.object.to_s}"
          location = " near #{tag.object.files.first.join(':')}" if tag.object.files.first
        end
        log.warn "invalid @#{tag.tag_name} tag#{object}#{location}"
        return nil
      end
      tag
    end
def requires_attrs ( tag , * attrs ) valid = true attrs . each do | a | valid &&= tag . send ( a ) break unless valid end unless valid if tag . object object = " in #{tag.object.to_s}" location = " near #{tag.object.files.first.join(':')}" if tag . object . files . first end log . warn "invalid @#{tag.tag_name} tag#{object}#{location}" return nil end tag end
Validates that the tag has non-nil values for the given attribute methods.
Validates that the tag has non - nil values for the given attribute methods .
tag
attrs