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