Sha256: e4899d13fe4c52e23ba8ae72039f9ae3d1d049814ff8129771a2d20d7551fa94

Contents?: true

Size: 405 Bytes

Versions: 12

Compression:

Stored size: 405 Bytes

Contents

module TresDelta
  class Response
    attr_reader :response

    def initialize(response)
      @response = response
    end

    def success?
      @response[:succeeded]
    end

    def method_missing(method, *args)
      @response[method]
    end

    def self.create_from_action(action, response)
      self.new(response.body["#{action}_response".to_sym]["#{action}_result".to_sym])
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
tres_delta-0.2.0 lib/tres_delta/response.rb
tres_delta-0.1.5 lib/tres_delta/response.rb
tres_delta-0.1.4.3 lib/tres_delta/response.rb
tres_delta-0.1.4.2 lib/tres_delta/response.rb
tres_delta-0.1.4.1 lib/tres_delta/response.rb
tres_delta-0.1.4 lib/tres_delta/response.rb
tres_delta-0.1.3 lib/tres_delta/response.rb
tres_delta-0.1.2 lib/tres_delta/response.rb
tres_delta-0.1.1 lib/tres_delta/response.rb
tres_delta-0.1.0 lib/tres_delta/response.rb
tres_delta-0.0.2 lib/tres_delta/response.rb
tres_delta-0.0.1 lib/tres_delta/response.rb