Class: Updox::Models::Practice
- Inherits:
-
Model
- Object
- Hashie::Trash
- Model
- Updox::Models::Practice
show all
- Defined in:
- lib/updox/models/practice.rb
Constant Summary
collapse
- CREATE_ENDPOINT =
'/PracticeCreate'.freeze
- FIND_ENDPOINT =
'/PracticeGet'.freeze
- QUERY_ENDPOINT =
'/PracticeList'.freeze
- LIST_TYPE =
'practiceList'.freeze
- LIST_NAME =
'practices'
- ITEM_TYPE =
'practice'
Instance Attribute Summary
Attributes inherited from Model
#updox_status
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Model
#as_json, #error_message, from_response, request, #response_code, #response_message, #successful?
Class Method Details
.exists?(account_id) ⇒ Boolean
42
43
44
|
# File 'lib/updox/models/practice.rb', line 42
def self.exists?(account_id)
false == self.find(account_id).nil?
end
|
.find(account_id) ⇒ Object
46
47
48
49
50
51
52
53
54
|
# File 'lib/updox/models/practice.rb', line 46
def self.find(account_id)
response = request(endpoint: FIND_ENDPOINT, body: {accountId: account_id}, required_auths: Updox::Models::Auth::AUTH_APP)
if response.successful?
response
else
nil
end
end
|