Class: Service::Client::RawInterface

Inherits:
Object
  • Object
show all
Defined in:
lib/service-client/raw_interface.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ RawInterface

Returns a new instance of RawInterface.



6
7
8
# File 'lib/service-client/raw_interface.rb', line 6

def initialize(client)
  @client = client
end

Instance Method Details

#adapterObject



26
27
28
# File 'lib/service-client/raw_interface.rb', line 26

def adapter
  @adapter ||= default_adapter
end

#adapter=(new_adapter) ⇒ Object



30
31
32
# File 'lib/service-client/raw_interface.rb', line 30

def adapter=(new_adapter)
  @adapter = new_adapter
end

#delete(url, body, options) ⇒ Object



22
23
24
# File 'lib/service-client/raw_interface.rb', line 22

def delete(url, body, options)
  request(:delete, url, body, options)
end

#get(url, body, options) ⇒ Object



10
11
12
# File 'lib/service-client/raw_interface.rb', line 10

def get(url, body, options)
  request(:get, url, body, options)
end

#post(url, body, options) ⇒ Object



18
19
20
# File 'lib/service-client/raw_interface.rb', line 18

def post(url, body, options)
  request(:post, url, body, options)
end

#put(url, body, options) ⇒ Object



14
15
16
# File 'lib/service-client/raw_interface.rb', line 14

def put(url, body, options)
  request(:put, url, body, options)
end

#request(method, url, body, options) ⇒ Object



34
35
36
# File 'lib/service-client/raw_interface.rb', line 34

def request(method, url, body, options)
  adapter.request(method, absolutize_url(url), body, options)
end