Sha256: 73f3593da96fff01cd8e6bbbff05571221823f32cbd6f1319973672b724a3610

Contents?: true

Size: 1.43 KB

Versions: 4

Compression:

Stored size: 1.43 KB

Contents

module Useless
  module Doc

    # Documentation for an action on a API resource.
    #
    # @!attribute [r] description
    #   @return [String] a description of the action.
    #
    # @!attribute [r] method
    #   @return [String] the action's HTTP method.
    #   @see Useless::Doc::Action::Method
    #
    # @!attribute [r] authentication_required
    #   @return [Boolean] whether or not the user needs to authenticate in
    #     order to perform this action.
    #
    # @!attribute [r] request
    #   @return [Request] the request documentation for the action.
    #
    # @!attribute [r] response
    #   @return [Response] the response documentation for the action.
    #
    class Action

      module Method
        GET     = 'GET'
        HEAD    = 'HEAD'
        POST    = 'POST'
        PUT     = 'PUT'
        PATCH   = 'PATCH'
        DELETE  = 'DELETE'
        TRACE   = 'TRACE'
        CONNECT = 'CONNECT'
      end

      attr_reader :description, :method, :authentication_required,
        :request, :response

      # @param [Hash] attrs corresponds to the class's instance attributes.
      #
      def initialize(attrs = {})
        @description              = attrs[:description]
        @method                   = attrs[:method]
        @authentication_required  = attrs[:authentication_required]
        @request                  = attrs[:request]
        @response                 = attrs[:response]
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
useless-doc-0.1.3 lib/useless/doc/action.rb
useless-doc-0.1.2 lib/useless/doc/action.rb
useless-doc-0.1.1 lib/useless/doc/action.rb
useless-doc-0.1.0 lib/useless/doc/action.rb