Class: Smess::Smsglobal

Inherits:
HttpBase show all
Defined in:
lib/smess/outputs/smsglobal.rb

Instance Attribute Summary collapse

Attributes inherited from Output

#config, #sms

Instance Method Summary collapse

Methods inherited from HttpBase

#initialize

Methods included from Logging

#logger

Methods inherited from Output

#initialize

Constructor Details

This class inherits a constructor from Smess::HttpBase

Instance Attribute Details

#passwordObject

Returns the value of attribute password.



14
15
16
# File 'lib/smess/outputs/smsglobal.rb', line 14

def password
  @password
end

#sender_idObject

Returns the value of attribute sender_id.



14
15
16
# File 'lib/smess/outputs/smsglobal.rb', line 14

def sender_id
  @sender_id
end

#usernameObject

Returns the value of attribute username.



14
15
16
# File 'lib/smess/outputs/smsglobal.rb', line 14

def username
  @username
end

Instance Method Details

#deliverObject



7
8
9
10
11
12
# File 'lib/smess/outputs/smsglobal.rb', line 7

def deliver
  request.url = url
  request.body = params

  http_post request
end

#validate_configObject



15
16
17
18
19
# File 'lib/smess/outputs/smsglobal.rb', line 15

def validate_config
  @username = config.fetch(:username)
  @password = config.fetch(:password)
  @sender_id = config.fetch(:sender_id, Smess.config.default_sender_id)
end