Exception: TD::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/tdlib/errors.rb

Overview

Proxy class that is used in failed promises to represent TDlib errors

Instance Method Summary collapse

Constructor Details

#initialize(td_error) ⇒ Error

Returns a new instance of Error.



10
11
12
# File 'lib/tdlib/errors.rb', line 10

def initialize(td_error)
  @td_error = td_error
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



14
15
16
# File 'lib/tdlib/errors.rb', line 14

def method_missing(method, *args)
  @td_error.public_send(method, *args)
end

Instance Method Details

#messageObject



26
27
28
# File 'lib/tdlib/errors.rb', line 26

def message
  @td_error.message
end

#respond_to_missing?(*args) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/tdlib/errors.rb', line 18

def respond_to_missing?(*args)
  @td_error.respond_to?(*args)
end

#to_sObject Also known as: inspect



22
23
24
# File 'lib/tdlib/errors.rb', line 22

def to_s
  @td_error.inspect
end