Class: Service::Client::RawInterface
- Inherits:
-
Object
- Object
- Service::Client::RawInterface
- Defined in:
- lib/service-client/raw_interface.rb
Instance Method Summary collapse
- #adapter ⇒ Object
- #adapter=(new_adapter) ⇒ Object
- #delete(url, body, options) ⇒ Object
- #get(url, body, options) ⇒ Object
-
#initialize(client) ⇒ RawInterface
constructor
A new instance of RawInterface.
- #post(url, body, options) ⇒ Object
- #put(url, body, options) ⇒ Object
- #request(method, url, body, options) ⇒ Object
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
#adapter ⇒ Object
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, ) request(:delete, url, body, ) end |
#get(url, body, options) ⇒ Object
10 11 12 |
# File 'lib/service-client/raw_interface.rb', line 10 def get(url, body, ) request(:get, url, body, ) end |
#post(url, body, options) ⇒ Object
18 19 20 |
# File 'lib/service-client/raw_interface.rb', line 18 def post(url, body, ) request(:post, url, body, ) end |
#put(url, body, options) ⇒ Object
14 15 16 |
# File 'lib/service-client/raw_interface.rb', line 14 def put(url, body, ) request(:put, url, body, ) end |
#request(method, url, body, options) ⇒ Object
34 35 36 |
# File 'lib/service-client/raw_interface.rb', line 34 def request(method, url, body, ) adapter.request(method, absolutize_url(url), body, ) end |