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 generate_validators_attributes(validators)
        result = {}
        validators.each do |validator|
          case validator
          when ::ActiveModel::Validations::PresenceValidator
            result[:required] = true
          when ::ActiveModel::Validations::LengthValidator
            result.merge! validator.options
          when ::ActiveModel::Validations::FormatValidator
            result[:pattern] = validator.options[:with]&.source
          end
        end
        result
      end
def generate_validators_attributes ( validators ) result = { } validators . each do | validator | case validator when :: ActiveModel :: Validations :: PresenceValidator result [ :required ] = true when :: ActiveModel :: Validations :: LengthValidator result . merge! validator . options when :: ActiveModel :: Validations :: FormatValidator result [ :pattern ] = validator . options [ :with ] &. source end end result 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
validators
<not_specific>