Sha256: 3ae8efef7ab44fef84549e7a4715c4c6290d35c8735417595524fcb3f7e6b603
Contents?: true
Size: 826 Bytes
Versions: 13
Compression:
Stored size: 826 Bytes
Contents
module Restly::Base::Resource::Finders def find(id, *args) options = args.extract_options! #params[pagination_options[:params][:page]] = options[:page] if pagination instance_from_response connection.get(path_with_format(id), params: params) end def all collection_from_response connection.get(path_with_format, params: params) end def create(attributes = nil, options = {}) instance = self.new(attributes, options) instance.save end def collection_from_response(response) raise Restly::Error::InvalidResponse unless response.is_a? OAuth2::Response Restly::Collection.new resource, nil, response: response end def instance_from_response(response) new(nil, response: response, connection: connection) end alias_method :from_response, :instance_from_response end
Version data entries
13 entries across 13 versions & 1 rubygems