Exception: AgentC::Errors::AbortCostExceeded

Inherits:
Base
  • Object
show all
Defined in:
lib/agent_c/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cost_type:, current_cost:, threshold:) ⇒ AbortCostExceeded

Returns a new instance of AbortCostExceeded.



11
12
13
14
15
16
# File 'lib/agent_c/errors.rb', line 11

def initialize(cost_type:, current_cost:, threshold:)
  @cost_type = cost_type
  @current_cost = current_cost
  @threshold = threshold
  super("Abort: #{cost_type} cost $#{current_cost.round(2)} exceeds threshold $#{threshold.round(2)}")
end

Instance Attribute Details

#cost_typeObject (readonly)

Returns the value of attribute cost_type.



9
10
11
# File 'lib/agent_c/errors.rb', line 9

def cost_type
  @cost_type
end

#current_costObject (readonly)

Returns the value of attribute current_cost.



9
10
11
# File 'lib/agent_c/errors.rb', line 9

def current_cost
  @current_cost
end

#thresholdObject (readonly)

Returns the value of attribute threshold.



9
10
11
# File 'lib/agent_c/errors.rb', line 9

def threshold
  @threshold
end