Class: Saorin::Client::Base::Batch

Inherits:
Array
  • Object
show all
Includes:
UUID
Defined in:
lib/saorin/client/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from UUID

#uuid

Constructor Details

#initialize(client) ⇒ Batch

Returns a new instance of Batch.



44
45
46
47
# File 'lib/saorin/client/base.rb', line 44

def initialize(client)
  super()
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



42
43
44
# File 'lib/saorin/client/base.rb', line 42

def client
  @client
end

Instance Method Details

#applyObject



57
58
59
60
# File 'lib/saorin/client/base.rb', line 57

def apply
  return [] if empty?
  @client.apply(self) || []
end

#call(method, *args) ⇒ Object



49
50
51
# File 'lib/saorin/client/base.rb', line 49

def call(method, *args)
  push Saorin::Request.new(method, args, :id => uuid)
end

#notify(method, *args) ⇒ Object



53
54
55
# File 'lib/saorin/client/base.rb', line 53

def notify(method, *args)
  push Saorin::Request.new(method, args)
end