Sha256: 79fe6c2e52fc9151bc37c468237cf1cb72492cfadbb4157558505b14340e91c4

Contents?: true

Size: 785 Bytes

Versions: 8

Compression:

Stored size: 785 Bytes

Contents

module RspecApiDocs
  class Resource
    class ResponseField
      attr_reader :name, :field

      def initialize(name, field)
        @name = name
        @field = field
      end

      # The scope of the response field
      #
      # @return [Array<String>]
      def scope
        field[:scope]
      end

      # The type of the response field
      #
      # @return [String]
      def type
        field[:type]
      end

      # The description of the response field
      #
      # @return [String]
      def description
        field[:description]
      end

      # Example value
      def example
        field[:example]
      end

      # @return [true, false]
      def ==(other)
        name == other.name &&
          field == other.field
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rspec-api-docs-1.1.0 lib/rspec_api_docs/formatter/resource/response_field.rb
rspec-api-docs-1.0.0 lib/rspec_api_docs/formatter/resource/response_field.rb
rspec-api-docs-0.14.0 lib/rspec_api_docs/formatter/resource/response_field.rb
rspec-api-docs-0.13.0 lib/rspec_api_docs/formatter/resource/response_field.rb
rspec-api-docs-0.12.0 lib/rspec_api_docs/formatter/resource/response_field.rb
rspec-api-docs-0.11.0 lib/rspec_api_docs/formatter/resource/response_field.rb
rspec-api-docs-0.10.0 lib/rspec_api_docs/formatter/resource/response_field.rb
rspec-api-docs-0.9.0 lib/rspec_api_docs/formatter/resource/response_field.rb