Module: Saorin::Client::Base
Defined Under Namespace
Modules: UUID
Classes: Batch
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Formatter
#default_formatter, #formatter
Methods included from UUID
#uuid
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
19
20
21
|
# File 'lib/saorin/client/base.rb', line 19
def options
@options
end
|
Instance Method Details
#apply(request) ⇒ Object
33
34
35
36
37
38
|
# File 'lib/saorin/client/base.rb', line 33
def apply(request)
response = send_request dump_request(request)
content = process_response response
raise content if content.is_a?(Saorin::RPCError)
content
end
|
#batch ⇒ Object
63
64
65
|
# File 'lib/saorin/client/base.rb', line 63
def batch
Batch.new self
end
|
#call(method, *args) ⇒ Object
25
26
27
|
# File 'lib/saorin/client/base.rb', line 25
def call(method, *args)
apply Saorin::Request.new(method, args, :id => uuid)
end
|
#initialize(options = {}) ⇒ Object
21
22
23
|
# File 'lib/saorin/client/base.rb', line 21
def initialize(options = {})
@options = options
end
|
#notify(method, *args) ⇒ Object
29
30
31
|
# File 'lib/saorin/client/base.rb', line 29
def notify(method, *args)
apply Saorin::Request.new(method, args)
end
|