Sha256: 24ed3afc030e4ba4b0a426e02e6d0aead712201453a43c7db175421b41061f35

Contents?: true

Size: 825 Bytes

Versions: 92

Compression:

Stored size: 825 Bytes

Contents

require 'acfs/response/formats'
require 'acfs/response/status'
require 'active_support/core_ext/module/delegation'

module Acfs

  # This represents a response. In addition to an standard HTTP
  # it has a field `data` for storing the encoded body.
  #
  class Response
    attr_accessor :data
    attr_reader :headers, :body, :request, :status

    include Response::Formats
    include Response::Status

    #delegate :status, :status_message, :success?, :modified?, :timed_out?,
    #         :response_body, :response_headers, :response_code, :headers,
    #         to: :response

    def initialize(request, data = {})
      @request  = request
      @status   = data[:status]  || 0
      @headers  = data[:headers] || {}
      @body     = data[:body]    || ''
      @data     = data[:data]    || nil
    end
  end
end

Version data entries

92 entries across 92 versions & 1 rubygems

Version Path
acfs-0.42.0 lib/acfs/response.rb
acfs-0.41.1 lib/acfs/response.rb
acfs-0.41.1.beta1 lib/acfs/response.rb
acfs-0.41.0 lib/acfs/response.rb
acfs-0.40.1.rc1 lib/acfs/response.rb
acfs-0.40.0 lib/acfs/response.rb
acfs-0.39.1 lib/acfs/response.rb
acfs-0.39.0 lib/acfs/response.rb
acfs-1.0.0.dev.1.b305 lib/acfs/response.rb
acfs-0.38.0 lib/acfs/response.rb
acfs-1.0.0.dev.1.b298 lib/acfs/response.rb
acfs-1.0.0.dev.1.b297 lib/acfs/response.rb
acfs-0.37.0.1.b295 lib/acfs/response.rb
acfs-0.37.0 lib/acfs/response.rb
acfs-0.36.0.1.b293 lib/acfs/response.rb
acfs-0.36.0 lib/acfs/response.rb
acfs-0.35.0.1.b291 lib/acfs/response.rb
acfs-0.35.0 lib/acfs/response.rb
acfs-0.34.1.1.b289 lib/acfs/response.rb
acfs-0.34.1 lib/acfs/response.rb