Class: Verify2::Channels::WhatsApp

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(to:, from: nil) ⇒ WhatsApp

Returns a new instance of WhatsApp.



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

def initialize(to:, from: nil)
  self.channel = 'whatsapp'
  self.to = to
  self.from = from if from
end

Instance Attribute Details

#channelObject

Returns the value of attribute channel.



8
9
10
# File 'lib/vonage/verify2/channels/whats_app.rb', line 8

def channel
  @channel
end

#fromObject

Returns the value of attribute from.



8
9
10
# File 'lib/vonage/verify2/channels/whats_app.rb', line 8

def from
  @from
end

#toObject

Returns the value of attribute to.



8
9
10
# File 'lib/vonage/verify2/channels/whats_app.rb', line 8

def to
  @to
end

Instance Method Details

#to_hObject



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

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