Sha256: 1974a88a5a76894e425baa712f638af1c5185393311838a9c79c582ef94c9ee3

Contents?: true

Size: 325 Bytes

Versions: 1

Compression:

Stored size: 325 Bytes

Contents

module Marvel
  module Response
    class Error < StandardError
      attr_reader :code, :status

      def initialize(response_hash)
        @code = response_hash['code']
        @status = response_hash['status'] || response_hash['message']
      end

      def to_s
        "#{@code} #{@status}"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
marvel_api-0.2.1 lib/marvel/error.rb