Module: Axel::ServiceResource::TyphoidExtensions::ClassMethods
- Defined in:
- app/models/axel/service_resource/typhoid_extensions.rb
Instance Method Summary collapse
- #build_typhoid_request(request_uri = nil, options = {}) ⇒ Object
- #builder ⇒ Object
- #default_request_options ⇒ Object
- #manual_request(method, uri, request_options = {}) ⇒ Object
-
#path(path = nil) ⇒ Object
Manually register a path, useful if the API Proxy is pointing at the wrong location or doesn’t know about the location.
- #retrieve_default_request_options(options) ⇒ Object
-
#site(url = nil) ⇒ Object
Manually register base URL, useful if the API Proxy is pointing at the wrong location or doesn’t know about the location.
Instance Method Details
#build_typhoid_request(request_uri = nil, options = {}) ⇒ Object
108 109 110 111 |
# File 'app/models/axel/service_resource/typhoid_extensions.rb', line 108 def build_typhoid_request(request_uri = nil, = {}) uri = request_uri || self.request_uri Typhoid::RequestBuilder.new(self, uri, ) end |
#builder ⇒ Object
100 101 102 |
# File 'app/models/axel/service_resource/typhoid_extensions.rb', line 100 def builder ::Axel::ServiceResource::Builder end |
#default_request_options ⇒ Object
94 |
# File 'app/models/axel/service_resource/typhoid_extensions.rb', line 94 def ;end |
#manual_request(method, uri, request_options = {}) ⇒ Object
96 97 98 |
# File 'app/models/axel/service_resource/typhoid_extensions.rb', line 96 def manual_request(method, uri, = {}) Typhoeus::Request.send method, uri, end |
#path(path = nil) ⇒ Object
Manually register a path, useful if the API Proxy is pointing at the wrong location or doesn’t know about the location
122 123 124 125 126 127 128 129 130 |
# File 'app/models/axel/service_resource/typhoid_extensions.rb', line 122 def path(path = nil) if resource resource.path = path if path resource.path else @path = path if path @path || resource_name end end |
#retrieve_default_request_options(options) ⇒ Object
104 105 106 |
# File 'app/models/axel/service_resource/typhoid_extensions.rb', line 104 def () RequestOptions.new(, ).compiled end |
#site(url = nil) ⇒ Object
Manually register base URL, useful if the API Proxy is pointing at the wrong location or doesn’t know about the location
115 116 117 118 |
# File 'app/models/axel/service_resource/typhoid_extensions.rb', line 115 def site(url = nil) @site = url if url resource ? (@site || resource.base_url) : @site end |