Class: Emb::BatchModelProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/emb/batch.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, name) ⇒ BatchModelProxy

Returns a new instance of BatchModelProxy.



50
51
52
53
# File 'lib/emb/batch.rb', line 50

def initialize(client, name)
  @client = client
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



48
49
50
# File 'lib/emb/batch.rb', line 48

def name
  @name
end

Instance Method Details

#[](text, *texts) ⇒ Object



55
56
57
# File 'lib/emb/batch.rb', line 55

def [](text, *texts)
  Emb.build_batch_loader(@client, @name, texts.empty? ? text : [text, *texts])
end

#inspectObject



59
60
61
# File 'lib/emb/batch.rb', line 59

def inspect
  "#<Emb::BatchModelProxy #{@name}>"
end