Class: M360::SMS::Globelabs
- Inherits:
-
Object
- Object
- M360::SMS::Globelabs
- Includes:
- HTTParty
- Defined in:
- lib/m360/sms/globelabs.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#response_body ⇒ Object
readonly
Returns the value of attribute response_body.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(options = {}) ⇒ Globelabs
constructor
A new instance of Globelabs.
- #success? ⇒ Boolean
Constructor Details
#initialize(options = {}) ⇒ Globelabs
Returns a new instance of Globelabs.
14 15 16 17 18 19 20 |
# File 'lib/m360/sms/globelabs.rb', line 14 def initialize( = {}) @passphrase = .fetch(:passphrase, ENV['M360_GLABS_PASSPHRASE']) @sender = .fetch(:sender, ENV['M360_GLABS_SENDER']) @correlator = [:correlator] @address = .fetch(:address) @message = .fetch(:message) end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
12 13 14 |
# File 'lib/m360/sms/globelabs.rb', line 12 def response @response end |
#response_body ⇒ Object (readonly)
Returns the value of attribute response_body.
12 13 14 |
# File 'lib/m360/sms/globelabs.rb', line 12 def response_body @response_body end |
Class Method Details
.call(options = {}) ⇒ Object
22 23 24 |
# File 'lib/m360/sms/globelabs.rb', line 22 def self.call( = {}) new().call end |
Instance Method Details
#call ⇒ Object
26 27 28 29 |
# File 'lib/m360/sms/globelabs.rb', line 26 def call @response = perform_request @response_body = JSON.parse(@response.body) end |
#success? ⇒ Boolean
31 32 33 |
# File 'lib/m360/sms/globelabs.rb', line 31 def success? response.code == 201 end |