Class: Abenla::Client
- Inherits:
-
Object
- Object
- Abenla::Client
- Defined in:
- lib/abenla-ruby/client.rb
Instance Attribute Summary collapse
-
#brandName ⇒ Object
Returns the value of attribute brandName.
-
#key ⇒ Object
Returns the value of attribute key.
-
#secret ⇒ Object
Returns the value of attribute secret.
-
#serviceTypeId ⇒ Object
Returns the value of attribute serviceTypeId.
Instance Method Summary collapse
-
#initialize(key = nil, secret = nil, brandName = nil, serviceTypeId = nil) ⇒ Client
constructor
A new instance of Client.
- #message(content) ⇒ Object
Constructor Details
#initialize(key = nil, secret = nil, brandName = nil, serviceTypeId = nil) ⇒ Client
Returns a new instance of Client.
6 7 8 9 10 11 12 |
# File 'lib/abenla-ruby/client.rb', line 6 def initialize(key=nil, secret=nil, brandName=nil, serviceTypeId=nil) @key = key @secret = secret @brandName = brandName @serviceTypeId = serviceTypeId @api_host = 'api.abenla.com/Service.asmx' end |
Instance Attribute Details
#brandName ⇒ Object
Returns the value of attribute brandName.
4 5 6 |
# File 'lib/abenla-ruby/client.rb', line 4 def brandName @brandName end |
#key ⇒ Object
Returns the value of attribute key.
4 5 6 |
# File 'lib/abenla-ruby/client.rb', line 4 def key @key end |
#secret ⇒ Object
Returns the value of attribute secret.
4 5 6 |
# File 'lib/abenla-ruby/client.rb', line 4 def secret @secret end |
#serviceTypeId ⇒ Object
Returns the value of attribute serviceTypeId.
4 5 6 |
# File 'lib/abenla-ruby/client.rb', line 4 def serviceTypeId @serviceTypeId end |
Instance Method Details
#message(content) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/abenla-ruby/client.rb', line 14 def (content) params = { loginName: @key, brandName: @brandName, serviceTypeId: @serviceTypeId } sign = Signature.digest(@key, @secret, [@brandName, @serviceTypeId]) get(@api_host, '/SendSmsOTP', params.merge!(content: content.to_json, sign: sign)) end |