Sha256: 2187683eba6c7dc1ded36b5d9255f3f2fb5a68244a8a5e2c66c9798116e39e22

Contents?: true

Size: 536 Bytes

Versions: 30

Compression:

Stored size: 536 Bytes

Contents

# frozen_string_literal: true

class ServiceClient
  extend Sinclair::EnvSettable
  attr_reader :username, :password, :host, :port

  settings_prefix 'SERVICE'

  with_settings :username, :password, port: 80, hostname: 'my-host.com'

  def self.default
    @default ||= new
  end

  def initialize(
    username: self.class.username,
    password: self.class.password,
    port: self.class.port,
    hostname: self.class.hostname
  )
    @username = username
    @password = password
    @port = port
    @hostname = hostname
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
sinclair-2.1.1 spec/support/models/service_client.rb
sinclair-2.1.0 spec/support/models/service_client.rb
sinclair-2.0.1 spec/support/models/service_client.rb
sinclair-2.0.0 spec/support/models/service_client.rb
sinclair-1.16.3 spec/support/models/service_client.rb
sinclair-1.16.2 spec/support/models/service_client.rb
sinclair-1.16.1 spec/support/models/service_client.rb
sinclair-1.16.0 spec/support/models/service_client.rb
sinclair-1.15.0 spec/support/models/service_client.rb
sinclair-1.14.2 spec/support/models/service_client.rb
sinclair-1.14.1 spec/support/models/service_client.rb
sinclair-1.14.0 spec/support/models/service_client.rb
sinclair-1.13.0 spec/support/models/service_client.rb
sinclair-1.12.1 spec/support/models/service_client.rb
sinclair-1.12.0 spec/support/models/service_client.rb
sinclair-1.11.0 spec/support/models/service_client.rb
sinclair-1.10.0 spec/support/models/service_client.rb
sinclair-1.9.0 spec/support/models/service_client.rb
sinclair-1.8.0 spec/support/models/service_client.rb
sinclair-1.7.0 spec/support/models/service_client.rb