Class: Smess::LinkMobility

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

Instance Attribute Summary collapse

Attributes inherited from Output

#config, #sms

Instance Method Summary collapse

Methods inherited from HttpBase

#initialize, #sender_id

Methods included from Logging

#logger

Methods inherited from Output

#check, #initialize, #send_feedback, #verify

Constructor Details

This class inherits a constructor from Smess::HttpBase

Instance Attribute Details

#gate_idObject

Returns the value of attribute gate_id.



17
18
19
# File 'lib/smess/outputs/link_mobility.rb', line 17

def gate_id
  @gate_id
end

#passwordObject

Returns the value of attribute password.



17
18
19
# File 'lib/smess/outputs/link_mobility.rb', line 17

def password
  @password
end

#platform_idObject

Returns the value of attribute platform_id.



17
18
19
# File 'lib/smess/outputs/link_mobility.rb', line 17

def platform_id
  @platform_id
end

#platform_partner_idObject

Returns the value of attribute platform_partner_id.



17
18
19
# File 'lib/smess/outputs/link_mobility.rb', line 17

def platform_partner_id
  @platform_partner_id
end

#usernameObject

Returns the value of attribute username.



17
18
19
# File 'lib/smess/outputs/link_mobility.rb', line 17

def username
  @username
end

Instance Method Details

#deliverObject



8
9
10
11
12
13
14
15
# File 'lib/smess/outputs/link_mobility.rb', line 8

def deliver
  request.auth.basic(username, password)
  request.url = url
  request.headers["Content-Type"] = "application/json"
  request.body = body

  http_post request
end

#validate_configObject



18
19
20
21
22
23
24
25
# File 'lib/smess/outputs/link_mobility.rb', line 18

def validate_config
  @username  = config.fetch(:username)
  @password  = config.fetch(:password)
  @platform_id  = config.fetch(:platform_id)
  @platform_partner_id  = config.fetch(:platform_partner_id)
  @gate_id  = config.fetch(:gate_id)
  @sender_id  = config.fetch(:sender_id, @sender_id)
end