Class: HostsFile::Host
- Inherits:
-
Object
- Object
- HostsFile::Host
- Defined in:
- lib/hosts_file/host.rb
Instance Attribute Summary collapse
-
#aliases ⇒ Object
Returns the value of attribute aliases.
-
#canonical_hostname ⇒ Object
Returns the value of attribute canonical_hostname.
-
#ip_address ⇒ Object
Returns the value of attribute ip_address.
Instance Method Summary collapse
- #hostname ⇒ Object
-
#initialize(ip_address, canonical_hostname, aliases = []) ⇒ Host
constructor
A new instance of Host.
- #ip ⇒ Object
- #name ⇒ Object
Constructor Details
#initialize(ip_address, canonical_hostname, aliases = []) ⇒ Host
Returns a new instance of Host.
5 6 7 8 9 |
# File 'lib/hosts_file/host.rb', line 5 def initialize(ip_address, canonical_hostname, aliases = []) @ip_address = ip_address @canonical_hostname = canonical_hostname @aliases = aliases end |
Instance Attribute Details
#aliases ⇒ Object
Returns the value of attribute aliases.
3 4 5 |
# File 'lib/hosts_file/host.rb', line 3 def aliases @aliases end |
#canonical_hostname ⇒ Object
Returns the value of attribute canonical_hostname.
3 4 5 |
# File 'lib/hosts_file/host.rb', line 3 def canonical_hostname @canonical_hostname end |
#ip_address ⇒ Object
Returns the value of attribute ip_address.
3 4 5 |
# File 'lib/hosts_file/host.rb', line 3 def ip_address @ip_address end |
Instance Method Details
#hostname ⇒ Object
15 16 17 |
# File 'lib/hosts_file/host.rb', line 15 def hostname canonical_hostname end |
#ip ⇒ Object
19 20 21 |
# File 'lib/hosts_file/host.rb', line 19 def ip ip_address end |
#name ⇒ Object
11 12 13 |
# File 'lib/hosts_file/host.rb', line 11 def name hostname end |