Module: Assembly::Actions::Read::ClassMethods

Defined in:
lib/assembly/actions/read.rb

Instance Method Summary collapse

Instance Method Details

#fetch(id, params = {}, client = Assembly.client) ⇒ Object Also known as: find

Raises:

  • (ArgumentError)


5
6
7
8
9
# File 'lib/assembly/actions/read.rb', line 5

def fetch(id, params={}, client=Assembly.client)
  raise ArgumentError.new("an id must be provided to fetch a record") if id.nil? || id.to_s.empty?
  response = client.get("#{path}/#{id}", params)
  Util.build(response, client)
end