Module: Saorin::Client::Base

Includes:
UUID, Formatter
Included in:
Faraday
Defined in:
lib/saorin/client/base.rb

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

#optionsObject (readonly)

Returns the value of attribute options.



20
21
22
# File 'lib/saorin/client/base.rb', line 20

def options
  @options
end

Instance Method Details

#apply(request) ⇒ Object



34
35
36
37
38
39
# File 'lib/saorin/client/base.rb', line 34

def apply(request)
  response = send_request dump_request(request)
  content = process_response response
  raise content if content.is_a?(Saorin::RPCError)
  content
end

#batchObject



64
65
66
# File 'lib/saorin/client/base.rb', line 64

def batch
  Batch.new self
end

#call(method, *args) ⇒ Object



26
27
28
# File 'lib/saorin/client/base.rb', line 26

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

#initialize(options = {}) ⇒ Object



22
23
24
# File 'lib/saorin/client/base.rb', line 22

def initialize(options = {})
  @options = options
end

#notify(method, *args) ⇒ Object



30
31
32
# File 'lib/saorin/client/base.rb', line 30

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