module Useless module Doc class Request # Documentation for a request parameter for an API action. # # @!attribute [r] type # @return [String] either "path" if it's part of the URL path, or # "query" if it's part of the query string. # # @!attribute [r] key # @return [String] the key of the parameter. # # @!attribute [r] required # @return [Boolean] whether or not the parameter is required. If it is # required, and the attribute is omitted, the response should have a # 4xx code. # # @!attribute [r] default # @return [String, Numeric] the value used if the parameter is omitted # and is not required. # # @!attribute [r] description # @return [String] a description of the parameter. # class Parameter module Type PATH = 'path' QUERY = 'query' end attr_reader :type, :key, :required, :default, :description # @param [Hash] attrs corresponds to the class's instance attributes. # def initialize(attrs = {}) @type = attrs[:type] @key = attrs[:key] @required = attrs[:required] @default = attrs[:default] @description = attrs[:description] end end end end end