Sha256: e87bd2dfc9bc5d1e52bbfb4621b4123f4eaff569c7c6f8fdba5ee3b8ab95ff0c

Contents?: true

Size: 416 Bytes

Versions: 1

Compression:

Stored size: 416 Bytes

Contents

class YouTrack::Client::Users < YouTrack::Client::Collection
  model YouTrack::Client::User

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

  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
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
you_track-0.4.8 lib/you_track/client/models/users.rb