Class: PEClient::Resource::BaseWithPort

Inherits:
Object
  • Object
show all
Defined in:
lib/pe_client/resources/base_with_port.rb

Overview

Base class for PEClient resources where a custom port is needed.

Instance Method Summary collapse

Constructor Details

#initialize(client, port: self.class::PORT) ⇒ BaseWithPort

We need to customise the port

Parameters:

  • client (PEClient::Client)
  • port (Integer) (defaults to: self.class::PORT)

    Port number for the service



25
26
27
28
29
30
# File 'lib/pe_client/resources/base_with_port.rb', line 25

def initialize(client, port: self.class::PORT)
  @client = client.deep_dup

  @client.base_url.port = port
  @client.connection.url_prefix = @client.base_url
end