Class: Smart::REST::Client
- Inherits:
-
Object
- Object
- Smart::REST::Client
- Includes:
- ClassSupportMixin, Configuration
- Defined in:
- lib/smart/rest/client.rb
Constant Summary collapse
- HTTP_HEADERS =
{ 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'Authorization' => 'WSSE realm="SDP",profile="UsernameToken"' }
Instance Attribute Summary collapse
-
#access_code ⇒ Object
readonly
Returns the value of attribute access_code.
-
#creation_time ⇒ Object
readonly
Returns the value of attribute creation_time.
-
#mobile_number ⇒ Object
readonly
Returns the value of attribute mobile_number.
-
#nonce ⇒ Object
readonly
Returns the value of attribute nonce.
-
#path_to_cert ⇒ Object
readonly
Returns the value of attribute path_to_cert.
-
#sp_id ⇒ Object
readonly
Returns the value of attribute sp_id.
-
#sp_password ⇒ Object
readonly
Returns the value of attribute sp_password.
-
#sp_service_id ⇒ Object
readonly
Returns the value of attribute sp_service_id.
-
#trans_id ⇒ Object
readonly
Returns the value of attribute trans_id.
Instance Method Summary collapse
Methods included from Configuration
Methods included from ClassSupportMixin
Instance Attribute Details
#access_code ⇒ Object (readonly)
Returns the value of attribute access_code.
30 31 32 |
# File 'lib/smart/rest/client.rb', line 30 def access_code @access_code end |
#creation_time ⇒ Object (readonly)
Returns the value of attribute creation_time.
30 31 32 |
# File 'lib/smart/rest/client.rb', line 30 def creation_time @creation_time end |
#mobile_number ⇒ Object (readonly)
Returns the value of attribute mobile_number.
30 31 32 |
# File 'lib/smart/rest/client.rb', line 30 def mobile_number @mobile_number end |
#nonce ⇒ Object (readonly)
Returns the value of attribute nonce.
30 31 32 |
# File 'lib/smart/rest/client.rb', line 30 def nonce @nonce end |
#path_to_cert ⇒ Object (readonly)
Returns the value of attribute path_to_cert.
30 31 32 |
# File 'lib/smart/rest/client.rb', line 30 def path_to_cert @path_to_cert end |
#sp_id ⇒ Object (readonly)
Returns the value of attribute sp_id.
30 31 32 |
# File 'lib/smart/rest/client.rb', line 30 def sp_id @sp_id end |
#sp_password ⇒ Object (readonly)
Returns the value of attribute sp_password.
30 31 32 |
# File 'lib/smart/rest/client.rb', line 30 def sp_password @sp_password end |
#sp_service_id ⇒ Object (readonly)
Returns the value of attribute sp_service_id.
30 31 32 |
# File 'lib/smart/rest/client.rb', line 30 def sp_service_id @sp_service_id end |
#trans_id ⇒ Object (readonly)
Returns the value of attribute trans_id.
30 31 32 |
# File 'lib/smart/rest/client.rb', line 30 def trans_id @trans_id end |
Instance Method Details
#headers ⇒ Object
32 33 34 35 36 37 |
# File 'lib/smart/rest/client.rb', line 32 def headers HTTP_HEADERS.merge! ({ 'X-WSSE' => %{ "UsernameToken Username="#{self.sp_id}",PasswordDigest="#{self.sp_password}",Nonce="#{self.nonce}", Created="#{self.creation_time}"}, 'X-RequestHeader' => %{ "request TransId="",ServiceId="#{self.service_id}" } }) end |
#send_sms(args = {}) ⇒ Object
39 40 41 42 |
# File 'lib/smart/rest/client.rb', line 39 def send_sms(args = {}) request = setup_connection(args) response = connect(request) end |