Class: Verify2::Channels::Email
- Inherits:
-
Object
- Object
- Verify2::Channels::Email
- Defined in:
- lib/vonage/verify2/channels/email.rb
Instance Attribute Summary collapse
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
-
#from ⇒ Object
Returns the value of attribute from.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(to:, from: nil) ⇒ Email
constructor
A new instance of Email.
- #to_h ⇒ Object
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
#channel ⇒ Object
Returns the value of attribute channel.
8 9 10 |
# File 'lib/vonage/verify2/channels/email.rb', line 8 def channel @channel end |
#from ⇒ Object
Returns the value of attribute from.
8 9 10 |
# File 'lib/vonage/verify2/channels/email.rb', line 8 def from @from end |
#to ⇒ Object
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_h ⇒ Object
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 |