Sha256: bf889e812e390fdeb991250661018f4a0c9b6da7acb2b7dfa0f52a3f6931cefb

Contents?: true

Size: 759 Bytes

Versions: 9

Compression:

Stored size: 759 Bytes

Contents

module Whiplash
  module App
    module FinderMethods

      def count(resource, params = {}, headers = nil)
        get("#{resource}/count", params, headers).body["count"]
      end

      def create(resource, params, headers = nil)
        post("#{resource}", params, headers)
      end

      def destroy(resource, id, headers = nil)
        delete("#{resource}", { id: id }, headers)
      end

      def find(resource, id, headers = nil)
        get("#{resource}", { id: id }, headers)
      end

      def find_all(resource, params = {}, headers = nil)
        get("#{resource}", params, headers)
      end

      def update(resource, id, params = {}, headers = nil)
        put("#{resource}", params.merge(id: id), headers)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
whiplash-app-0.3.8 lib/whiplash/app/finder_methods.rb
whiplash-app-0.3.7 lib/whiplash/app/finder_methods.rb
whiplash-app-0.3.6 lib/whiplash/app/finder_methods.rb
whiplash-app-0.3.5 lib/whiplash/app/finder_methods.rb
whiplash-app-0.3.4 lib/whiplash/app/finder_methods.rb
whiplash-app-0.3.3 lib/whiplash/app/finder_methods.rb
whiplash-app-0.3.1 lib/whiplash/app/finder_methods.rb
whiplash-app-0.3.0 lib/whiplash/app/finder_methods.rb
whiplash-app-0.2.0 lib/whiplash/app/finder_methods.rb