lib/maestrano/connec/client.rb in maestrano-0.11.0 vs lib/maestrano/connec/client.rb in maestrano-0.12.0

- old
+ new

@@ -1,30 +1,31 @@ require 'httparty' module Maestrano module Connec - class Client + include Preset include ::HTTParty headers 'Accept' => 'application/vnd.api+json' headers 'Content-Type' => 'application/vnd.api+json' format :json attr_reader :group_id def initialize(group_id) @group_id = group_id - self.class.base_uri("#{Maestrano.param('connec.host')}#{Maestrano.param('connec.base_path')}") + self.class.base_uri("#{Maestrano[self.class.preset].param('connec.host')}#{Maestrano[self.class.preset].param('connec.base_path')}") end # Return the default options which includes # maestrano authentication def default_options { basic_auth: { - username: Maestrano.param('api.id'), - password: Maestrano.param('api.key') - } + username: Maestrano[self.class.preset].param('api.id'), + password: Maestrano[self.class.preset].param('api.key') + }, + timeout: Maestrano[self.class.preset].param('connec.timeout') } end # Return the right path scoped using the customer # group id \ No newline at end of file