Class: CampactUserService::Client
- Inherits:
-
Object
- Object
- CampactUserService::Client
- Defined in:
- lib/campact_user_service/client.rb
Constant Summary collapse
- TIMEOUT =
60.freeze
- OPEN_TIMEOUT =
20.freeze
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#topt_authorization ⇒ Object
readonly
Returns the value of attribute topt_authorization.
Instance Method Summary collapse
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/campact_user_service/client.rb', line 13 def initialize() @host = .fetch(:host) @port = [:port] @topt_authorization = [:topt_authorization] = .merge(.delete(:faraday) || {}) adapter = .delete(:adapter) || Faraday.default_adapter @connection = Faraday.new(endpoint, ) do |faraday| faraday.adapter adapter end end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
11 12 13 |
# File 'lib/campact_user_service/client.rb', line 11 def connection @connection end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
11 12 13 |
# File 'lib/campact_user_service/client.rb', line 11 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
11 12 13 |
# File 'lib/campact_user_service/client.rb', line 11 def port @port end |
#topt_authorization ⇒ Object (readonly)
Returns the value of attribute topt_authorization.
11 12 13 |
# File 'lib/campact_user_service/client.rb', line 11 def @topt_authorization end |