Method: FreshdeskAPI::Read#find!
- Defined in:
- lib/freshdesk_api/actions.rb
#find!(client, options = {}) ⇒ Object
Finds a resource by an id and any options passed in
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/freshdesk_api/actions.rb', line 20 def find!(client, = {}) @client = client # so we can use client.logger in rescue raise ArgumentError, 'No :id given' unless [:id] path = api_url() + "/#{options[:id]}" response = client.make_request!(path, :get) new(@client).tap do |resource| resource.attributes.merge!() resource.handle_response(response) end end |