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 unless app_hash.nil?
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

#content_idObject

Returns the value of attribute content_id.



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

def content_id
  @content_id
end

#entity_idObject

Returns the value of attribute entity_id.



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

def entity_id
  @entity_id
end

#fromObject

Returns the value of attribute from.



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

def from
  @from
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



42
43
44
45
46
47
48
# File 'lib/vonage/verify2/channels/sms.rb', line 42

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