Sha256: d8a948f52dd8265dc7ae1dcba48a98fc7d1f1b92b4278aab1a6911116d97db09

Contents?: true

Size: 355 Bytes

Versions: 1

Compression:

Stored size: 355 Bytes

Contents

module Glare
  class ApiResponse
    def initialize(response)
      @response = response
    end

    def result
      content['result']
    end

    def valid!
      raise Glare::Errors::ApiError unless success?
      self
    end

    private

    def success?
      content['success']
    end

    def content
      @response.content
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
glare-0.2.0 lib/glare/api_response.rb