Class: Payloop::Wrappers::Anthropic
- Inherits:
-
Object
- Object
- Payloop::Wrappers::Anthropic
- Defined in:
- lib/payloop/wrappers/anthropic.rb
Overview
Wrapper for Anthropic Ruby client
Instance Method Summary collapse
-
#initialize(config, collector, sentinel = nil) ⇒ Anthropic
constructor
A new instance of Anthropic.
- #register(client) ⇒ Object
Constructor Details
#initialize(config, collector, sentinel = nil) ⇒ Anthropic
Returns a new instance of Anthropic.
9 10 11 12 13 |
# File 'lib/payloop/wrappers/anthropic.rb', line 9 def initialize(config, collector, sentinel = nil) @config = config @collector = collector @sentinel = sentinel end |
Instance Method Details
#register(client) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/payloop/wrappers/anthropic.rb', line 15 def register(client) validate_client!(client) # Prevent double registration return client if client.instance_variable_defined?(:@payloop_registered) # Store references in client instance client.instance_variable_set(:@payloop_config, @config) client.instance_variable_set(:@payloop_collector, @collector) client.instance_variable_set(:@payloop_sentinel, @sentinel) client.instance_variable_set(:@payloop_registered, true) # Wrap the messages method (client) client end |