Class: MTProto::RPC::SendCode
- Inherits:
-
Object
- Object
- MTProto::RPC::SendCode
- Defined in:
- lib/mtproto/rpc/send_code.rb
Instance Method Summary collapse
- #call(phone_number, code_settings: {}) ⇒ Object
- #call_sync(phone_number, code_settings: {}) ⇒ Object
-
#initialize(client) ⇒ SendCode
constructor
A new instance of SendCode.
Constructor Details
#initialize(client) ⇒ SendCode
Returns a new instance of SendCode.
9 10 11 |
# File 'lib/mtproto/rpc/send_code.rb', line 9 def initialize(client) @client = client end |
Instance Method Details
#call(phone_number, code_settings: {}) ⇒ Object
13 14 15 16 17 |
# File 'lib/mtproto/rpc/send_code.rb', line 13 def call(phone_number, code_settings: {}) query = build_query(phone_number, code_settings) @client.rpc.call(query) end |
#call_sync(phone_number, code_settings: {}) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/mtproto/rpc/send_code.rb', line 19 def call_sync(phone_number, code_settings: {}) query = build_query(phone_number, code_settings) response = @client.rpc.call_sync(query) Type::RPC::Auth::SentCode.parse(response) end |