class Sshhub::Keychain
Attributes
username[R]
Public Class Methods
new(username)
click to toggle source
# File lib/sshhub/keychain.rb, line 7 def initialize(username) @username = username end
Public Instance Methods
keys()
click to toggle source
# File lib/sshhub/keychain.rb, line 11 def keys @keys ||= api_data.map{|key| Sshhub::Key.new(key) } end
length()
click to toggle source
# File lib/sshhub/keychain.rb, line 15 def length keys.length end
many?()
click to toggle source
# File lib/sshhub/keychain.rb, line 19 def many? length > 1 end
Private Instance Methods
api_data()
click to toggle source
# File lib/sshhub/keychain.rb, line 25 def api_data client.user_keys(username) rescue Octokit::NotFound [] end
client()
click to toggle source
# File lib/sshhub/keychain.rb, line 31 def client @client ||= Octokit::Client.new end