Class: Bond::Connection
- Inherits:
-
Object
- Object
- Bond::Connection
- Defined in:
- lib/bond/connection.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
Returns the value of attribute connection.
Class Method Summary collapse
-
.connection ⇒ Faraday
Create instances of connection object to ensure thread safety.
Instance Method Summary collapse
-
#initialize ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize ⇒ Connection
Returns a new instance of Connection.
15 16 17 18 19 |
# File 'lib/bond/connection.rb', line 15 def initialize connection = Faraday.new(url: Bond::API_URL) connection.basic_auth(Bond.api_key, nil) @connection = connection end |
Instance Attribute Details
#connection ⇒ Object
Returns the value of attribute connection.
5 6 7 |
# File 'lib/bond/connection.rb', line 5 def connection @connection end |
Class Method Details
.connection ⇒ Faraday
Create instances of connection object to ensure thread safety
10 11 12 |
# File 'lib/bond/connection.rb', line 10 def connection new.connection end |