Class: Radar::User

Inherits:
API::Resource show all
Defined in:
lib/radar/user.rb

Constant Summary collapse

RESOURCE_NAME =
{ singular: 'user', plural: 'users' }.freeze

Class Method Summary collapse

Methods inherited from API::Resource

api_client, class_name, descendants, #initialize, resource_base_path, #to_h

Constructor Details

This class inherits a constructor from Radar::API::Resource

Class Method Details

.all(params: nil) ⇒ Object



5
6
7
8
9
# File 'lib/radar/user.rb', line 5

def self.all(params: nil)
  path = resource_base_path
  response = api_client.get(path, params: params)
  api_client.parsed_response(response, object_class: self)
end

.delete(id:) ⇒ Object



17
18
19
20
# File 'lib/radar/user.rb', line 17

def self.delete(id:)
  path = [resource_base_path, id].join('/')
  api_client.delete(path)
end

.find(id:, params: nil) ⇒ Object



11
12
13
14
15
# File 'lib/radar/user.rb', line 11

def self.find(id:, params: nil)
  path = [resource_base_path, id].join('/')
  response = api_client.get(path)
  api_client.parsed_response(response, object_class: self)
end