Module: SmoothOperator::Operator::ClassMethods

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

Instance Attribute Details

#headersObject



64
65
66
# File 'lib/smooth_operator/operator.rb', line 64

def headers
  Helpers.get_instance_variable(self, :headers, {})
end

Instance Method Details

#make_the_call(http_verb, relative_path = '', data = {}, options = {}) ⇒ Object



71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/smooth_operator/operator.rb', line 71

def make_the_call(http_verb, relative_path = '', data = {}, options = {})
  operator_args = operator_method_args(http_verb, relative_path, data, options)

  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



85
86
87
# File 'lib/smooth_operator/operator.rb', line 85

def query_string(params)
  params
end