Class: OldApiResource::Mocks::Interface

Inherits:
Object
  • Object
show all
Defined in:
lib/old_api_resource/mocks.rb

Overview

A simple interface class to change the new connection to look like the old activeresource connection

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Interface

Returns a new instance of Interface.



14
15
16
# File 'lib/old_api_resource/mocks.rb', line 14

def initialize(path)
  @path = path
end

Instance Method Details

#delete(*args, &block) ⇒ Object



27
28
29
# File 'lib/old_api_resource/mocks.rb', line 27

def delete(*args, &block)
  Connection.send(:delete, @path, *args, &block)
end

#get(*args, &block) ⇒ Object



18
19
20
# File 'lib/old_api_resource/mocks.rb', line 18

def get(*args, &block)
  Connection.send(:get, @path, *args, &block)
end

#head(*args, &block) ⇒ Object



30
31
32
# File 'lib/old_api_resource/mocks.rb', line 30

def head(*args, &block)
  Connection.send(:head, @path, *args, &block)
end

#post(*args, &block) ⇒ Object



21
22
23
# File 'lib/old_api_resource/mocks.rb', line 21

def post(*args, &block)
  Connection.send(:post, @path, *args, &block)
end

#put(*args, &block) ⇒ Object



24
25
26
# File 'lib/old_api_resource/mocks.rb', line 24

def put(*args, &block)
  Connection.send(:put, @path, *args, &block)
end