Class: KaveRestApi::RequestBase
- Inherits:
-
Object
- Object
- KaveRestApi::RequestBase
- Defined in:
- lib/kavenegar-ruby/requests/RequestBase.rb
Direct Known Subclasses
Cancel, Config, CountInBox, CountPostalCode, Deliver, Info, LatestOutBox, Lookup, Receive, SelectOutBox, SendSimple, Tts
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ RequestBase
constructor
A new instance of RequestBase.
Constructor Details
#initialize(args = {}) ⇒ RequestBase
Returns a new instance of RequestBase.
3 4 5 6 7 8 9 |
# File 'lib/kavenegar-ruby/requests/RequestBase.rb', line 3 def initialize(args = {}) config = KaveRestApi.configuration raise(ArgumentError, 'not a valid configuration class') if config.nil? || config.api_key.nil? || config.default_sender.nil? @API_URL = "https://api.kavenegar.com/v1/#{config.api_key}" @DEFAULT_SENDER = config.default_sender.freeze @FORMAT= config.format rescue 'json' end |