Class: QuickeyRubySdk::App
- Inherits:
-
Object
- Object
- QuickeyRubySdk::App
- Defined in:
- lib/quickey_ruby_sdk/app.rb
Instance Attribute Summary collapse
-
#api_base ⇒ Object
readonly
Returns the value of attribute api_base.
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
Instance Method Summary collapse
- #getMetaData ⇒ Object
-
#initialize(api_key: nil) ⇒ App
constructor
A new instance of App.
- #sendOTP(phone, provider) ⇒ Object
Constructor Details
#initialize(api_key: nil) ⇒ App
Returns a new instance of App.
9 10 11 12 |
# File 'lib/quickey_ruby_sdk/app.rb', line 9 def initialize(api_key: nil) @api_key = api_key @api_base = QuickeyRubySdk::API_BASE end |
Instance Attribute Details
#api_base ⇒ Object (readonly)
Returns the value of attribute api_base.
6 7 8 |
# File 'lib/quickey_ruby_sdk/app.rb', line 6 def api_base @api_base end |
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
7 8 9 |
# File 'lib/quickey_ruby_sdk/app.rb', line 7 def api_key @api_key end |
Instance Method Details
#getMetaData ⇒ Object
14 15 16 |
# File 'lib/quickey_ruby_sdk/app.rb', line 14 def getMetaData JSON.parse HTTParty.post(@api_base+"/auth/apiKey", body: { "apiKey": @api_key }).body end |
#sendOTP(phone, provider) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/quickey_ruby_sdk/app.rb', line 18 def sendOTP(phone, provider) response = JSON.parse HTTParty.post(@api_base+"/otp/sendToUserPhone", body: { "phone": phone, "provider": provider }, headers: { "Authorization": @api_key }).body response end |