Skip to content

Commit

Permalink
Add auto-initialization with default config
Browse files Browse the repository at this point in the history
  • Loading branch information
NuckChorris committed Aug 21, 2023
1 parent fc2ed1e commit dfa8ef8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
typesensual (0.3.0)
typesensual (0.3.1)
activesupport (>= 6.1.5)
paint (>= 2.0.0)
typesense (>= 0.13.0)
Expand Down
8 changes: 5 additions & 3 deletions lib/typesensual.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@

class Typesensual
class << self
attr_accessor :config

def client
config&.client
end

def configure(&block)
self.config = Typesensual::Config.new(&block)
@config = Typesensual::Config.new(&block)
end

def config
@config ||= Typesensual::Config.new
end

# Get the collections that match the alias name
Expand Down
2 changes: 1 addition & 1 deletion lib/typesensual/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

class Typesensual
VERSION = '0.3.0'
VERSION = '0.3.1'
end

0 comments on commit dfa8ef8

Please sign in to comment.