Class: Glabssms::SmsResult

Inherits:
Object
  • Object
show all
Includes:
BaseModule
Defined in:
lib/glabssms/sms_result.rb

Overview

This class is used as a response object when we successfully send an SMS to a subscriber

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BaseModule

included

Methods included from BaseModule::Methods

#set_instance_variables_from_hash

Constructor Details

#initialize(attributes) ⇒ SmsResult

Returns a new instance of SmsResult.



13
14
15
16
17
18
# File 'lib/glabssms/sms_result.rb', line 13

def initialize(attributes)
  message_request = attributes.dig('outboundSMSMessageRequest')
  @number = message_request.dig('address')
  @sender_address = message_request.dig('senderAddress')
  @message = message_request.dig('outboundSMSTextMessage', 'message')
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



11
12
13
# File 'lib/glabssms/sms_result.rb', line 11

def message
  @message
end

#numberObject (readonly)

Returns the value of attribute number.



9
10
11
# File 'lib/glabssms/sms_result.rb', line 9

def number
  @number
end

#sender_addressObject (readonly)

Returns the value of attribute sender_address.



10
11
12
# File 'lib/glabssms/sms_result.rb', line 10

def sender_address
  @sender_address
end

Class Method Details

._new(*args) ⇒ Object



22
23
24
# File 'lib/glabssms/sms_result.rb', line 22

def _new(*args)
  new(*args)
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/glabssms/sms_result.rb', line 27

def success?
  true
end