Sha256: bc6aa4eb0975355438abd7e9d7511793ae7a144a810bc1c83690d1db4755b0e1

Contents?: true

Size: 560 Bytes

Versions: 2

Compression:

Stored size: 560 Bytes

Contents

module Copy
  module Operations
    module Find
      module ClassMethods
        # Finds a given object
        #
        # @param [Integer] id The id of the object that should be found
        # @return [Copy::Base] The found object
        def find(attibutes)
          id = attibutes.delete(:id)
          response = Copy.request(:get, nil, api_member_url({id: id}), {}, options_for_request(attributes))
          self.new(response["data"])
        end
      end

      def self.included(base)
        base.extend(ClassMethods)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
copy-ruby-0.0.2 lib/copy/operations/find.rb
copy-ruby-0.0.1 lib/copy/operations/find.rb