Class: Net::SSH::HostKeys
- Inherits:
-
Object
- Object
- Net::SSH::HostKeys
- Includes:
- Enumerable
- Defined in:
- lib/net/ssh/known_hosts.rb
Overview
Represents the result of a search in known hosts see search_for
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
Instance Method Summary collapse
- #add_host_key(key) ⇒ Object
- #each(&block) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(host_keys, host, known_hosts, options = {}) ⇒ HostKeys
constructor
A new instance of HostKeys.
Constructor Details
#initialize(host_keys, host, known_hosts, options = {}) ⇒ HostKeys
Returns a new instance of HostKeys.
73 74 75 76 77 78 |
# File 'lib/net/ssh/known_hosts.rb', line 73 def initialize(host_keys, host, known_hosts, = {}) @host_keys = host_keys @host = host @known_hosts = known_hosts @options = end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
71 72 73 |
# File 'lib/net/ssh/known_hosts.rb', line 71 def host @host end |
Instance Method Details
#add_host_key(key) ⇒ Object
80 81 82 83 |
# File 'lib/net/ssh/known_hosts.rb', line 80 def add_host_key(key) @known_hosts.add(@host, key, @options) @host_keys.push(key) end |
#each(&block) ⇒ Object
85 86 87 |
# File 'lib/net/ssh/known_hosts.rb', line 85 def each(&block) @host_keys.each(&block) end |
#empty? ⇒ Boolean
89 90 91 |
# File 'lib/net/ssh/known_hosts.rb', line 89 def empty? @host_keys.empty? end |