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