Sha256: fc3731113c58e7aa599500a4b96a4178a65cdb4ad721dd9dccdfdb1016ba0001

Contents?: true

Size: 604 Bytes

Versions: 7

Compression:

Stored size: 604 Bytes

Contents

require 'hashie/mash'
module Mirage
  class Request
    include HTTParty

    class << self
      alias_method :backedup_get, :get
      def get url
        result = Hashie::Mash.new(backedup_get(url, format: :json))
        request = new
        request.parameters = result.parameters
        request.headers = result.headers
        request.request_url = result.request_url
        request.body = result.body
        request.id = result.id
        request
      end
    end

    attr_accessor :parameters, :headers, :body, :request_url, :id

    def delete
      self.class.delete(id)
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
mirage-3.0.11 lib/mirage/client/request.rb
mirage-3.0.10 lib/mirage/client/request.rb
mirage-3.0.9 lib/mirage/client/request.rb
mirage-on-thin-3.0.8 lib/mirage/client/request.rb
mirage-3.0.8 lib/mirage/client/request.rb
mirage-3.0.7 lib/mirage/client/request.rb
mirage-3.0.6 lib/mirage/client/request.rb