Class: ClaudeAgentSDK::TaskUsage

Inherits:
Type
  • Object
show all
Defined in:
lib/claude_agent_sdk/types.rb

Overview

Typed usage data for task progress and notifications

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Type

#[], #[]=, from_hash, #to_h, wrap

Constructor Details

#initialize(attributes = {}) ⇒ TaskUsage

Returns a new instance of TaskUsage.



340
341
342
343
344
345
# File 'lib/claude_agent_sdk/types.rb', line 340

def initialize(attributes = {})
  super
  @total_tokens ||= 0
  @tool_uses    ||= 0
  @duration_ms  ||= 0
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ClaudeAgentSDK::Type

Instance Attribute Details

#duration_msObject

Returns the value of attribute duration_ms.



338
339
340
# File 'lib/claude_agent_sdk/types.rb', line 338

def duration_ms
  @duration_ms
end

#tool_usesObject

Returns the value of attribute tool_uses.



338
339
340
# File 'lib/claude_agent_sdk/types.rb', line 338

def tool_uses
  @tool_uses
end

#total_tokensObject

Returns the value of attribute total_tokens.



338
339
340
# File 'lib/claude_agent_sdk/types.rb', line 338

def total_tokens
  @total_tokens
end