Module: Evoke::HTTMockParty::ClassMethods

Defined in:
lib/evoke_client/mock.rb

Instance Method Summary collapse

Instance Method Details

#base_uri(uri = nil) ⇒ Object



11
12
13
14
# File 'lib/evoke_client/mock.rb', line 11

def base_uri(uri=nil)
  @base_uri = uri if uri
  @base_uri
end

#delete(path, query = {}) ⇒ Object



27
# File 'lib/evoke_client/mock.rb', line 27

def delete(path, query={}) HTTMockParty.router("delete").dispatch(path, query); end

#format(fmt = nil) ⇒ Object



16
17
18
19
# File 'lib/evoke_client/mock.rb', line 16

def format(fmt=nil)
  @format = fmt if fmt
  @format
end

#get(path, query = {}) ⇒ Object

The mock part. Your code will call these methods and get a real HTTParty::Response



24
# File 'lib/evoke_client/mock.rb', line 24

def get(path, query={}) HTTMockParty.router("get").dispatch(path, query); end

#post(path, query = {}) ⇒ Object



25
# File 'lib/evoke_client/mock.rb', line 25

def post(path, query={}) HTTMockParty.router("post").dispatch(path, query); end

#put(path, query = {}) ⇒ Object



26
# File 'lib/evoke_client/mock.rb', line 26

def put(path, query={}) HTTMockParty.router("put").dispatch(path, query); end