Class: Verify2::Channels::SMS

Inherits:
Object
  • Object
show all
Defined in:
lib/vonage/verify2/channels/sms.rb

Constant Summary collapse

APP_HASH_LENGTH =
11

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(to:, app_hash: nil) ⇒ SMS

Returns a new instance of SMS.



11
12
13
14
15
# File 'lib/vonage/verify2/channels/sms.rb', line 11

def initialize(to:, app_hash: nil)
  self.channel = 'sms'
  self.to = to
  self.app_hash = app_hash if app_hash
end

Instance Attribute Details

#app_hashObject

Returns the value of attribute app_hash.



9
10
11
# File 'lib/vonage/verify2/channels/sms.rb', line 9

def app_hash
  @app_hash
end

#channelObject

Returns the value of attribute channel.



9
10
11
# File 'lib/vonage/verify2/channels/sms.rb', line 9

def channel
  @channel
end

#toObject

Returns the value of attribute to.



9
10
11
# File 'lib/vonage/verify2/channels/sms.rb', line 9

def to
  @to
end

Instance Method Details

#to_hObject



27
28
29
30
31
32
33
# File 'lib/vonage/verify2/channels/sms.rb', line 27

def to_h
  hash = Hash.new
  self.instance_variables.each do |ivar|
    hash[ivar.to_s.delete("@").to_sym] = self.instance_variable_get(ivar)
  end
  hash
end