Class: Tanker::CTanker::CPhoneNumberVerification

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/tanker/c_tanker/c_verification.rb

Instance Method Summary collapse

Constructor Details

#initialize(phone_number, verification_code) ⇒ CPhoneNumberVerification

Returns a new instance of CPhoneNumberVerification.



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/tanker/c_tanker/c_verification.rb', line 32

def initialize(phone_number, verification_code)
  super()

  # NOTE: Instance variables are required to keep the CStrings alive
  @phone_number = CTanker.new_cstring phone_number
  @verification_code = CTanker.new_cstring verification_code

  self[:version] = 1
  self[:phone_number] = @phone_number
  self[:verification_code] = @verification_code
end