Sha256: aafbe680b08fa5a0d6a5ebaf7d129e0396bc98165d65af3bf759640eb03166a5

Contents?: true

Size: 735 Bytes

Versions: 5

Compression:

Stored size: 735 Bytes

Contents

module CandyCheck
  module PlayStore
    # Represents a failing call against the Google API server
    class VerificationFailure
      include Utils::AttributeReader

      # @return [Hash] the raw attributes returned from the server
      attr_reader :error

      # Initializes a new instance which bases on a JSON result
      # from Google API servers
      # @param error [Hash]
      def initialize(error)
        @error = error
      end

      # The code of the failure
      # @return [Fixnum]
      def code
        Integer(error.status_code)
      rescue
        -1
      end

      # The message of the failure
      # @return [String]
      def message
        error.message || "Unknown error"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
candy_check-0.5.0 lib/candy_check/play_store/verification_failure.rb
candy_check-0.4.0 lib/candy_check/play_store/verification_failure.rb
candy_check-0.3.0 lib/candy_check/play_store/verification_failure.rb
candy_check-0.2.1 lib/candy_check/play_store/verification_failure.rb
candy_check-0.2.0 lib/candy_check/play_store/verification_failure.rb