Skip to content

Commit 9580107

Browse files
committed
Change initializer to keyword arguments style
1 parent 04028f4 commit 9580107

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

bin/console

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require "cohere"
1212
# Pry.start
1313

1414
client = Cohere::Client.new(
15-
ENV['COHERE_API_KEY']
15+
api_key: ENV['COHERE_API_KEY']
1616
)
1717

1818
require "irb"

lib/cohere/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Client
88

99
ENDPOINT_URL = "https://api.cohere.ai/v1"
1010

11-
def initialize(api_key, timeout: nil)
11+
def initialize(api_key:, timeout: nil)
1212
@api_key = api_key
1313
@timeout = timeout
1414
end

spec/cohere/client_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require "spec_helper"
44

55
RSpec.describe Cohere::Client do
6-
let(:instance) { described_class.new("123") }
6+
let(:instance) { described_class.new(api_key: "123") }
77

88
describe "#generate" do
99
let(:generate_result) { JSON.parse(File.read("spec/fixtures/generate_result.json")) }

0 commit comments

Comments
 (0)