Class: Vonage::BasicAndSignature
- Inherits:
-
AbstractAuthentication
- Object
- AbstractAuthentication
- Vonage::BasicAndSignature
- Defined in:
- lib/vonage/basic_and_signature.rb
Instance Method Summary collapse
Methods inherited from AbstractAuthentication
Constructor Details
This class inherits a constructor from Vonage::AbstractAuthentication
Instance Method Details
#update(object, data) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/vonage/basic_and_signature.rb', line 5 def update(object, data) if @config.authentication_preference == :signature return unless object.is_a?(Hash) object['api_key'] = T.must(@config).api_key object['timestamp'] =Time.now.to_i.to_s signature = Signature.new(@config).generate(object) object[:sig] = signature else return unless object.is_a?(Net::HTTPRequest) object.basic_auth(@config.api_key, @config.api_secret) end end |