Sha256: 591beb3e0dedb1bbd808bfd7a42d74e0cac01564e5c432e2d3beabb6bb4376ae

Contents?: true

Size: 514 Bytes

Versions: 2

Compression:

Stored size: 514 Bytes

Contents

class YouTrack::Client::User < YouTrack::Client::Model
  identity :id, aliases: ["fullName", "email"]

  attribute :last_created_project, aliases: ["lastCreatedProject"]
  attribute :email,                aliases: ["email"]

  def admin? # just try to make a request to the admin api and see what happens
    return @admin if defined?(@admin) # i love how ||= doesn't work when a variable is false
    @admin = !!service.get_admin_user(self.id).body
  rescue Faraday::ResourceNotFound
    @admin = false
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
you_track-0.4.0 lib/you_track/client/models/user.rb
you_track-0.3.0 lib/you_track/client/models/user.rb