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.



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

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

Instance Method Details

#[](text, *texts) ⇒ Object



61
62
63
# File 'lib/emb/batch.rb', line 61

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

#inspectObject



65
66
67
# File 'lib/emb/batch.rb', line 65

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