Class: MCP::Progress
- Inherits:
-
Object
- Object
- MCP::Progress
- Defined in:
- lib/mcp/progress.rb
Instance Method Summary collapse
-
#initialize(notification_target:, progress_token:, related_request_id: nil) ⇒ Progress
constructor
A new instance of Progress.
- #report(progress, total: nil, message: nil) ⇒ Object
Constructor Details
#initialize(notification_target:, progress_token:, related_request_id: nil) ⇒ Progress
Returns a new instance of Progress.
5 6 7 8 9 |
# File 'lib/mcp/progress.rb', line 5 def initialize(notification_target:, progress_token:, related_request_id: nil) @notification_target = notification_target @progress_token = progress_token @related_request_id = end |
Instance Method Details
#report(progress, total: nil, message: nil) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/mcp/progress.rb', line 11 def report(progress, total: nil, message: nil) return unless @progress_token return unless @notification_target @notification_target.notify_progress( progress_token: @progress_token, progress: progress, total: total, message: , related_request_id: @related_request_id, ) end |