Class: Github::Auth::Key

Inherits:
Struct
  • Object
show all
Defined in:
lib/github/auth/key.rb

Overview

Represents a username/key pair from GitHub

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#keyObject

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



4
5
6
# File 'lib/github/auth/key.rb', line 4

def key
  @key
end

#usernameObject

Returns the value of attribute username

Returns:

  • (Object)

    the current value of username



4
5
6
# File 'lib/github/auth/key.rb', line 4

def username
  @username
end

Instance Method Details

#to_aObject



5
6
7
# File 'lib/github/auth/key.rb', line 5

def to_a
  [self]
end

#to_sObject



9
10
11
# File 'lib/github/auth/key.rb', line 9

def to_s
  "#{key} #{url}"
end

#urlObject



13
14
15
# File 'lib/github/auth/key.rb', line 13

def url
  "https://github.com/#{username}"
end