Class: Github::Auth::KeysClient
- Inherits:
-
Object
- Object
- Github::Auth::KeysClient
- Defined in:
- lib/github/auth/keys_client.rb
Overview
Client for fetching public SSH keys using the Github API
Constant Summary collapse
- UsernameRequiredError =
Class.new StandardError
Class.new StandardError
- GithubUserDoesNotExistError =
Class.new StandardError
- DEFAULT_HOSTNAME =
'https://api.github.com'
- USER_AGENT =
"github_auth-#{VERSION}"
- DEFAULT_OPTIONS =
{ username: nil, hostname: DEFAULT_HOSTNAME }
Instance Attribute Summary collapse
-
#hostname ⇒ Object
readonly
Returns the value of attribute hostname.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ KeysClient
constructor
A new instance of KeysClient.
- #keys ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ KeysClient
Returns a new instance of KeysClient.
20 21 22 23 24 25 26 |
# File 'lib/github/auth/keys_client.rb', line 20 def initialize( = {}) = DEFAULT_OPTIONS.merge raise UsernameRequiredError unless .fetch :username @username = .fetch :username @hostname = .fetch :hostname end |
Instance Attribute Details
#hostname ⇒ Object (readonly)
Returns the value of attribute hostname.
6 7 8 |
# File 'lib/github/auth/keys_client.rb', line 6 def hostname @hostname end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
6 7 8 |
# File 'lib/github/auth/keys_client.rb', line 6 def username @username end |