Module: Layer::Operations::Find::ClassMethods

Included in:
Content, Conversation, Message, Webhook
Defined in:
lib/layer/operations/find.rb

Instance Method Summary collapse

Instance Method Details

#find(id, client = self.client) ⇒ Layer::Resource

Finds the resource with the given id

Parameters:

  • id (String)

    the resource’s id

  • client (Layer::Client) (defaults to: self.client)

    the client to use to make this request

Returns:

Raises:



12
13
14
15
16
# File 'lib/layer/operations/find.rb', line 12

def find(id, client = self.client)
  id = Layer::Client.normalize_id(id)
  response = client.get("#{url}/#{id}")
  from_response(response, client)
end