Class: CampactUserService::Client
- Inherits:
-
Object
- Object
- CampactUserService::Client
- Defined in:
- lib/campact_user_service/client.rb
Constant Summary collapse
- TIMEOUT =
5.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.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/campact_user_service/client.rb', line 12 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.
10 11 12 |
# File 'lib/campact_user_service/client.rb', line 10 def connection @connection end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
10 11 12 |
# File 'lib/campact_user_service/client.rb', line 10 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
10 11 12 |
# File 'lib/campact_user_service/client.rb', line 10 def port @port end |
#topt_authorization ⇒ Object (readonly)
Returns the value of attribute topt_authorization.
10 11 12 |
# File 'lib/campact_user_service/client.rb', line 10 def @topt_authorization end |