class LinuxHub::GithubUser

Attributes

email[R]
ssh_keys[R]
username[R]

Public Class Methods

new(username) click to toggle source
# File lib/linux-hub/github_user.rb, line 5
def initialize(username)
  @username = username
  fetch_user_details
end

Public Instance Methods

authorized_keys() click to toggle source
# File lib/linux-hub/github_user.rb, line 10
def authorized_keys
  ssh_keys.map do |key|
    "#{key} #{email}"
  end
end

Private Instance Methods

client() click to toggle source
# File lib/linux-hub/github_user.rb, line 23
def client
  Github.instance.client
end
fetch_user_details() click to toggle source
# File lib/linux-hub/github_user.rb, line 18
def fetch_user_details
  @email = client.user(@username).email || "#{@username}@github"
  @ssh_keys = client.user_keys(@username).collect(&:key)
end