Module: SmoothOperator::Operator
- Included in:
- Base
- Defined in:
- lib/smooth_operator/operator.rb
Constant Summary collapse
- OPTIONS =
[:endpoint, :endpoint_user, :endpoint_pass, :timeout]
Instance Attribute Summary collapse
Instance Method Summary collapse
- #make_the_call(http_verb, relative_path = '', data = {}, options = {}) ⇒ Object
- #query_string(params) ⇒ Object
Instance Attribute Details
#headers ⇒ Object
30 31 32 |
# File 'lib/smooth_operator/operator.rb', line 30 def headers Helpers.get_instance_variable(self, :headers, {}) end |
Instance Method Details
#make_the_call(http_verb, relative_path = '', data = {}, options = {}) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/smooth_operator/operator.rb', line 37 def make_the_call(http_verb, relative_path = '', data = {}, = {}) operator_args = operator_method_args(http_verb, relative_path, data, ) if Helpers.present?(operator_args[4][:hydra]) operator_call = Operators::Typhoeus else operator_call = Operators::Faraday end operator_call.make_the_call(*operator_args) do |remote_call| block_given? ? yield(remote_call) : remote_call end end |
#query_string(params) ⇒ Object
51 52 53 |
# File 'lib/smooth_operator/operator.rb', line 51 def query_string(params) params end |