Class: Vodka::Configuration
- Inherits:
-
Object
- Object
- Vodka::Configuration
- Defined in:
- lib/vodka/configuration.rb
Instance Attribute Summary collapse
-
#api_url ⇒ Object
Secret token to use in signing requests, stronger is better.
-
#digest ⇒ Object
Secret token to use in signing requests, stronger is better.
-
#her_auto_configure ⇒ Object
Secret token to use in signing requests, stronger is better.
-
#perform_request_signing ⇒ Object
Secret token to use in signing requests, stronger is better.
-
#prefix ⇒ Object
Secret token to use in signing requests, stronger is better.
-
#request_secret ⇒ Object
Secret token to use in signing requests, stronger is better.
-
#response_secret ⇒ Object
Secret token to use in signing requests, stronger is better.
Instance Method Summary collapse
- #configure_her! ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
11 12 13 14 15 |
# File 'lib/vodka/configuration.rb', line 11 def initialize @digest = Digest::SHA512 @perform_request_signing = true @her_auto_configure = true end |
Instance Attribute Details
#api_url ⇒ Object
Secret token to use in signing requests, stronger is better
3 4 5 |
# File 'lib/vodka/configuration.rb', line 3 def api_url @api_url end |
#digest ⇒ Object
Secret token to use in signing requests, stronger is better
3 4 5 |
# File 'lib/vodka/configuration.rb', line 3 def digest @digest end |
#her_auto_configure ⇒ Object
Secret token to use in signing requests, stronger is better
3 4 5 |
# File 'lib/vodka/configuration.rb', line 3 def her_auto_configure @her_auto_configure end |
#perform_request_signing ⇒ Object
Secret token to use in signing requests, stronger is better
3 4 5 |
# File 'lib/vodka/configuration.rb', line 3 def perform_request_signing @perform_request_signing end |
#prefix ⇒ Object
Secret token to use in signing requests, stronger is better
3 4 5 |
# File 'lib/vodka/configuration.rb', line 3 def prefix @prefix end |
#request_secret ⇒ Object
Secret token to use in signing requests, stronger is better
3 4 5 |
# File 'lib/vodka/configuration.rb', line 3 def request_secret @request_secret end |
#response_secret ⇒ Object
Secret token to use in signing requests, stronger is better
3 4 5 |
# File 'lib/vodka/configuration.rb', line 3 def response_secret @response_secret end |
Instance Method Details
#configure_her! ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/vodka/configuration.rb', line 17 def configure_her! raise Exception.new('api_url must be set') if api_url.nil? ::Her::API.setup(url: api_url) do |c| c.use(Vodka::Client::Middleware::ErrorAware) c.use(Vodka::Client::Middleware::SignedRequest) if perform_request_signing c.use(Faraday::Request::UrlEncoded) c.use(Vodka::Client::Middleware::SignedResponse) if perform_request_signing c.use(::Her::Middleware::SecondLevelParseJSON) c.use(Faraday::Adapter::NetHttp) end end |