Class: Youtrack::Resources::Users

Inherits:
Base
  • Object
show all
Defined in:
lib/youtrack/resources/users.rb

Constant Summary collapse

PATHS =
OpenStruct.new(
  current: '/users/me',
  users: '/users',
  user: '/users/%{id}'
)

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#delete_resource, descendants, #deserialize_response, #get_resource_with_fields, #initialize, #post_resource_with_fields, #prepare_payload, #query_params_for_fields

Constructor Details

This class inherits a constructor from Youtrack::Resources::Base

Instance Method Details

#all(params = {}) ⇒ Object



14
15
16
# File 'lib/youtrack/resources/users.rb', line 14

def all(params = {})
  get_resource_with_fields(model.minimal_fields, PATHS.users, params: params)
end

#by_id(id) ⇒ Object



18
19
20
# File 'lib/youtrack/resources/users.rb', line 18

def by_id(id)
  get_resource_with_fields(model.all_fields, PATHS.user % { id: id })
end

#currentObject



10
11
12
# File 'lib/youtrack/resources/users.rb', line 10

def current
  get_resource_with_fields(model.all_fields, PATHS.current)
end