Class: TgVizor::Transport::Result

Inherits:
Struct
  • Object
show all
Defined in:
lib/tgvizor/transport.rb

Overview

Outcome of a single send attempt.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#messageString?

Returns human-readable error message.

Returns:

  • (String, nil)

    human-readable error message



24
25
26
# File 'lib/tgvizor/transport.rb', line 24

Result = Struct.new(:ok, :retryable, :status, :message, keyword_init: true) do
  def ok? = ok
end

#okBoolean

Returns true on 202 Accepted.

Returns:

  • (Boolean)

    true on 202 Accepted



24
25
26
# File 'lib/tgvizor/transport.rb', line 24

Result = Struct.new(:ok, :retryable, :status, :message, keyword_init: true) do
  def ok? = ok
end

#retryableBoolean

Returns true if the caller should persist and retry later.

Returns:

  • (Boolean)

    true if the caller should persist and retry later



24
25
26
# File 'lib/tgvizor/transport.rb', line 24

Result = Struct.new(:ok, :retryable, :status, :message, keyword_init: true) do
  def ok? = ok
end

#statusInteger?

Returns HTTP status code, if any.

Returns:

  • (Integer, nil)

    HTTP status code, if any



24
25
26
# File 'lib/tgvizor/transport.rb', line 24

Result = Struct.new(:ok, :retryable, :status, :message, keyword_init: true) do
  def ok? = ok
end

Instance Method Details

#ok?Boolean

Returns:

  • (Boolean)


25
# File 'lib/tgvizor/transport.rb', line 25

def ok? = ok