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.



313
314
315
316
317
318
# File 'lib/claude_agent_sdk/types.rb', line 313

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.



311
312
313
# File 'lib/claude_agent_sdk/types.rb', line 311

def duration_ms
  @duration_ms
end

#tool_usesObject

Returns the value of attribute tool_uses.



311
312
313
# File 'lib/claude_agent_sdk/types.rb', line 311

def tool_uses
  @tool_uses
end

#total_tokensObject

Returns the value of attribute total_tokens.



311
312
313
# File 'lib/claude_agent_sdk/types.rb', line 311

def total_tokens
  @total_tokens
end