Class: Fog::Hetznercloud::Client
- Inherits:
-
Object
- Object
- Fog::Hetznercloud::Client
- Defined in:
- lib/fog/hetznercloud/client.rb
Instance Method Summary collapse
-
#initialize(endpoint, token, connection_options) ⇒ Client
constructor
A new instance of Client.
- #request(params) ⇒ Object
Constructor Details
#initialize(endpoint, token, connection_options) ⇒ Client
Returns a new instance of Client.
4 5 6 7 8 |
# File 'lib/fog/hetznercloud/client.rb', line 4 def initialize(endpoint, token, ) @endpoint = endpoint @token = token @connection_options = end |
Instance Method Details
#request(params) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/fog/hetznercloud/client.rb', line 10 def request(params) params[:headers] ||= {} params[:headers]['Content-Type'] ||= 'application/json' params[:headers]['Authorization'] ||= "Bearer #{@token}" params[:body] = encode_body(params) response = connection.request(params) response.body = decode_body(response) response end |