Module: Updox::Models::Extensions::Exists

Included in:
AppointmentStatus, Calendar, Location, User
Defined in:
lib/updox/models/extensions/exists.rb

Instance Method Summary collapse

Instance Method Details

#exists?(item_id, account_id:, cached_query: nil) ⇒ Boolean

Returns:

  • (Boolean)

Raises:



5
6
7
8
9
10
11
12
13
# File 'lib/updox/models/extensions/exists.rb', line 5

def exists?(item_id, account_id: , cached_query: nil)
  raise UpdoxException.new('Not implemented on this model.') unless self.respond_to?(:find)
  opts = { account_id:  }
  opts[:cached_query] = cached_query unless cached_query.nil?

  response = self.find(item_id, **opts)

  false == response.nil?
end