Sha256: 14c27e45cf99f9be6433605f6b03d7ab6b2fab36107457b3b386ef31c9f1cac0

Contents?: true

Size: 466 Bytes

Versions: 1

Compression:

Stored size: 466 Bytes

Contents

# frozen_string_literal: true

module Ares
  module Responses
    class TextCode
      attr_reader :elem, :code, :text

      def initialize(elem, code, text)
        @elem = elem
        @code = code
        @text = text
      end

      def to_s
        "#{@code}: #{text}"
      end

      def inspect
        "#<TextCode(#{elem}) code=#{code} text=#{text}>"
      end
    end

    class Error < TextCode
      def error?
        true
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ares.rb-0.4.0 lib/ares/responses.rb