Class: AgentHarness::ProviderConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/agent_harness/configuration.rb

Overview

Provider-specific configuration

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ ProviderConfig

Returns a new instance of ProviderConfig.



333
334
335
336
337
338
339
340
341
342
343
# File 'lib/agent_harness/configuration.rb', line 333

def initialize(name)
  @name = name.to_sym
  @enabled = true
  @type = :usage_based
  @priority = 10
  @models = []
  @default_flags = []
  @timeout = nil
  @model = nil
  @externally_sandboxed = false
end

Instance Attribute Details

#default_flagsObject

Returns the value of attribute default_flags.



328
329
330
# File 'lib/agent_harness/configuration.rb', line 328

def default_flags
  @default_flags
end

#enabledObject

Returns the value of attribute enabled.



328
329
330
# File 'lib/agent_harness/configuration.rb', line 328

def enabled
  @enabled
end

#externally_sandboxedObject

Returns the value of attribute externally_sandboxed.



328
329
330
# File 'lib/agent_harness/configuration.rb', line 328

def externally_sandboxed
  @externally_sandboxed
end

#modelObject

Returns the value of attribute model.



328
329
330
# File 'lib/agent_harness/configuration.rb', line 328

def model
  @model
end

#modelsObject

Returns the value of attribute models.



328
329
330
# File 'lib/agent_harness/configuration.rb', line 328

def models
  @models
end

#nameObject (readonly)

Returns the value of attribute name.



331
332
333
# File 'lib/agent_harness/configuration.rb', line 331

def name
  @name
end

#priorityObject

Returns the value of attribute priority.



328
329
330
# File 'lib/agent_harness/configuration.rb', line 328

def priority
  @priority
end

#timeoutObject

Returns the value of attribute timeout.



328
329
330
# File 'lib/agent_harness/configuration.rb', line 328

def timeout
  @timeout
end

#typeObject

Returns the value of attribute type.



328
329
330
# File 'lib/agent_harness/configuration.rb', line 328

def type
  @type
end

Instance Method Details

#merge!(options) ⇒ self

Merge options into this configuration

Parameters:

  • options (Hash)

    options to merge

Returns:

  • (self)


349
350
351
352
353
354
355
# File 'lib/agent_harness/configuration.rb', line 349

def merge!(options)
  options.each do |key, value|
    setter = "#{key}="
    send(setter, value) if respond_to?(setter)
  end
  self
end