lib/rest_doc_rails/model_documentation.rb
# any method placed here will apply to classes, like Hickwall
# def acts_as_something
#   send :include, InstanceMethods
# end
any method placed here will apply to classes, like Hickwall
def acts_as_something
send :include, InstanceMethods
end
any method placed here will apply to classes like Hickwall def acts_as_something send : include InstanceMethods end
def doc_attribute(attribute, description, skip_validators_attributes: false)
        self.attribute_doc ||= model_attribute_documentation
        self.attribute_doc[attribute][:description] = description
        unless skip_validators_attributes
          validators_attributes = generate_validators_attributes validators_on(attribute)
          if [:string].include? self.attribute_doc[attribute][:type]
            value = validators_attributes.delete :minimum
            validators_attributes[:minLength] = value if value
            value = validators_attributes.delete :maximum
            validators_attributes[:maxLength] = value if value
          end
          self.attribute_doc[attribute].merge! validators_attributes
        end
      end
def doc_attribute ( attribute , description , skip_validators_attributes : false ) self . attribute_doc ||= model_attribute_documentation self . attribute_doc [ attribute ] [ :description ] = description unless skip_validators_attributes validators_attributes = generate_validators_attributes validators_on ( attribute ) if [ :string ] . include? self . attribute_doc [ attribute ] [ :type ] value = validators_attributes . delete :minimum validators_attributes [ :minLength ] = value if value value = validators_attributes . delete :maximum validators_attributes [ :maxLength ] = value if value end self . attribute_doc [ attribute ] . merge! validators_attributes end end
any method placed here will apply to classes, like Hickwall
def acts_as_something
send :include, InstanceMethods
end
any method placed here will apply to classes like Hickwall def acts_as_something send : include InstanceMethods end
attribute
<not_specific>
description
<not_specific>
skip_validators_attributes
<not_specific>