Module: RestServiceClient::ClassMethods

Defined in:
lib/restserviceclient.rb

Instance Method Summary collapse

Instance Method Details

#debug(flag) ⇒ Object



63
64
65
# File 'lib/restserviceclient.rb', line 63

def debug(flag)
  define_method :get_debug, &-> { flag }
end

#delete(method_name, path = '', options = {}) ⇒ Object



83
84
85
# File 'lib/restserviceclient.rb', line 83

def delete(method_name, path = '', options = {})
  add_method :delete, method_name, path, options
end

#get(method_name, path = '', options = {}) ⇒ Object



67
68
69
# File 'lib/restserviceclient.rb', line 67

def get(method_name, path = '', options = {})
  add_method :get, method_name, path, options
end

#headers(default_headers) ⇒ Object



55
56
57
# File 'lib/restserviceclient.rb', line 55

def headers(default_headers)
  define_method :get_default_headers, &-> { default_headers }
end

#host(url) ⇒ Object



47
48
49
# File 'lib/restserviceclient.rb', line 47

def host(url)
  define_method :get_host, &-> { url }
end

#params(default_params) ⇒ Object



59
60
61
# File 'lib/restserviceclient.rb', line 59

def params(default_params)
  define_method :get_default_params, &-> { default_params }
end

#patch(method_name, path = '', options = {}) ⇒ Object



79
80
81
# File 'lib/restserviceclient.rb', line 79

def patch(method_name, path = '', options = {})
  add_method :patch, method_name, path, options
end

#post(method_name, path = '', options = {}) ⇒ Object



71
72
73
# File 'lib/restserviceclient.rb', line 71

def post(method_name, path = '', options = {})
  add_method :post, method_name, path, options
end

#put(method_name, path = '', options = {}) ⇒ Object



75
76
77
# File 'lib/restserviceclient.rb', line 75

def put(method_name, path = '', options = {})
  add_method :put, method_name, path, options
end

#serializer(serializer_class) ⇒ Object



51
52
53
# File 'lib/restserviceclient.rb', line 51

def serializer(serializer_class)
  define_method :get_serializer, &-> { serializer_class }
end