Module: SmoothOperator::Operator

Includes:
HttpMethods
Included in:
Base
Defined in:
lib/smooth_operator/operator.rb

Defined Under Namespace

Modules: ClassMethods, HttpMethods

Constant Summary

Constants included from HttpMethods

HttpMethods::HTTP_VERBS

Instance Method Summary collapse

Instance Method Details

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



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/smooth_operator/operator.rb', line 10

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

  relative_path = resource_path(relative_path)

  if !parent_object.nil? && options[:ignore_parent] != true
    options[:resources_name] ||= "#{parent_object.class.resources_name}/#{parent_object.get_primary_key}/#{self.class.resources_name}"
  end

  self.class.make_the_call(http_verb, relative_path, data, options) do |remote_call|
    yield(remote_call)
  end
end