Class: Rubyrag

Inherits:
Object
  • Object
show all
Defined in:
lib/rubyrag.rb,
lib/rubyrag/cloudflare_auto_rag.rb

Defined Under Namespace

Classes: Error, Rags

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(provider:, **options) ⇒ Rubyrag



10
11
12
13
14
15
16
17
# File 'lib/rubyrag.rb', line 10

def initialize(provider:, **options)
  @rag = case provider
         when :cloudflare_auto_rag
           Rubyrag::Rags::CloudflareAutoRag.new(options)
         else
           raise Error("Invalid provider: #{provider}")
         end
end

Instance Attribute Details

#ragObject (readonly)

Returns the value of attribute rag.



6
7
8
# File 'lib/rubyrag.rb', line 6

def rag
  @rag
end

Instance Method Details

#add(**options) ⇒ Object



19
20
21
# File 'lib/rubyrag.rb', line 19

def add(**options)
  rag.add(**options)
end

#query(**options) ⇒ Object



23
24
25
# File 'lib/rubyrag.rb', line 23

def query(**options)
  rag.query(**options)
end