lib/zendesk_api/actions.rb
# Finds a resource by an id and any options passed in.
# A custom path to search at can be passed into opts. It defaults to the {DataResource.resource_name} of the class. 
# @param [Client] client The {Client} object to be used
# @param [Hash] options Any additional GET parameters to be added
Finds a resource by an id and any options passed in.
A custom path to search at can be passed into opts. It defaults to the {DataResource.resource_name} of the class.
Finds a resource by an id and any options passed in . A custom path to search at can be passed into opts . It defaults to the { DataResource . resource_name } of the class .
def find(client, options = {})
      @client = client 
      raise "No :id given" unless options[:id] || options["id"]
      association = options.delete(:association) || Association.new(:class => self)
      response = client.connection.get(association.generate_path(options)) do |req|
        req.params = options
      end
      new(client, response.body[singular_resource_name])
    end
def find ( client , options = { } ) @client = client raise "No :id given" unless options [ :id ] || options [ "id" ] association = options . delete ( :association ) || Association . new ( :class => self ) response = client . connection . get ( association . generate_path ( options ) ) do | req | req . params = options end new ( client , response . body [ singular_resource_name ] ) end
Finds a resource by an id and any options passed in.
Finds a resource by an id and any options passed in .
# so we can use client.logger in rescue
client
<not_specific>
options
<not_specific>
<not_specific>
options Any additional GET parameters to be added
options Any additional GET parameters to be added