Class: Verify2::Channels::Email

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Email.



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

def initialize(to:, from: nil)
  self.channel = 'email'
  self.to = to
  self.from = from unless from.nil?
end

Instance Attribute Details

#channelObject

Returns the value of attribute channel.



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

def channel
  @channel
end

#fromObject

Returns the value of attribute from.



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

def from
  @from
end

#toObject

Returns the value of attribute to.



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

def to
  @to
end

Instance Method Details

#to_hObject



24
25
26
27
28
29
30
# File 'lib/vonage/verify2/channels/email.rb', line 24

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