Sha256: 98dc4431d00f4f199367e9e814f1b4cff2b69ee241f42fc2ee7f01ca9f1d02d1

Contents?: true

Size: 520 Bytes

Versions: 4

Compression:

Stored size: 520 Bytes

Contents

module Alephant
  module Broker
    class Response
      attr_accessor :content, :content_type
      attr_reader :status

      STATUS_CODE_MAPPING = {
        200 => 'ok',
        404 => 'Not found',
        500 => 'Error retrieving content'
      }

      def initialize(status = 200)
        @content_type = "text/html"
        self.status = status
        setup
      end

      def status=(code)
        @status = code
        @content = STATUS_CODE_MAPPING[code]
      end

      def setup; end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
alephant-broker-0.1.0 lib/alephant/broker/models/response.rb
alephant-broker-0.0.3 lib/alephant/broker/models/response.rb
alephant-broker-0.0.2 lib/alephant/broker/models/response.rb
alephant-broker-0.0.1 lib/alephant/broker/models/response.rb