module SmoothOperator::FinderMethods

Public Instance Methods

find(relative_path, data = {}, options = {}) { |remote_call| ... } click to toggle source
# File lib/smooth_operator/finder_methods.rb, line 6
def find(relative_path, data = {}, options = {})
  relative_path = '' if relative_path == :all

  get(relative_path, data, options) do |remote_call|
    if remote_call.ok?
      remote_call.object = HelperMethods
        .build_object(self, remote_call.parsed_response, options)
    end

    block_given? ? yield(remote_call) : remote_call
  end
end