Exception: AgentC::Errors::AbortCostExceeded
- Defined in:
- lib/agent_c/errors.rb
Instance Attribute Summary collapse
-
#cost_type ⇒ Object
readonly
Returns the value of attribute cost_type.
-
#current_cost ⇒ Object
readonly
Returns the value of attribute current_cost.
-
#threshold ⇒ Object
readonly
Returns the value of attribute threshold.
Instance Method Summary collapse
-
#initialize(cost_type:, current_cost:, threshold:) ⇒ AbortCostExceeded
constructor
A new instance of AbortCostExceeded.
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_type ⇒ Object (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_cost ⇒ Object (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 |
#threshold ⇒ Object (readonly)
Returns the value of attribute threshold.
9 10 11 |
# File 'lib/agent_c/errors.rb', line 9 def threshold @threshold end |