Class: YouTrack::Client::Users

Inherits:
Collection
  • Object
show all
Defined in:
lib/you_track/client/models/users.rb

Instance Method Summary collapse

Instance Method Details

#currentObject



4
5
6
# File 'lib/you_track/client/models/users.rb', line 4

def current
  service.users.new(service.get_current_user.body)
end

#get(username) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/you_track/client/models/users.rb', line 8

def get(username)
  service.users.new(service.get_user(username).body)
rescue Faraday::ClientError => e
  # yes 403 if you have valid creds BUT the user isn't there
  raise unless [403, 404].include?(e.response[:status])
  nil
end