Module: HaveAPI::Server::DocHelpers
- Defined in:
- lib/haveapi/server.rb
Instance Method Summary collapse
Instance Method Details
#format_param_type(param) ⇒ Object
125 126 127 128 |
# File 'lib/haveapi/server.rb', line 125 def format_param_type(param) return param[:type] if param[:type] != 'Resource' "<a href=\"#root-#{param[:resource].join('-')}-show\">#{param[:type]}</a>" end |
#format_validators(validators) ⇒ Object
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/haveapi/server.rb', line 130 def format_validators(validators) ret = '' return ret if validators.nil? validators.each do |name, opts| ret += "<h5>#{name.to_s.capitalize}</h5>" ret += '<dl>' opts.each do |k, v| ret += "<dt>#{k}</dt><dd>#{v}</dd>" end ret += '</dl>' end ret end |