Class: Carbios::Hostname
- Inherits:
-
Object
- Object
- Carbios::Hostname
- Defined in:
- lib/carbios/hostname.rb
Instance Attribute Summary collapse
-
#hostname ⇒ Object
readonly
Returns the value of attribute hostname.
Instance Method Summary collapse
-
#initialize(hostname, options = {}) ⇒ Hostname
constructor
A new instance of Hostname.
- #reverse ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(hostname, options = {}) ⇒ Hostname
Returns a new instance of Hostname.
6 7 8 9 10 11 |
# File 'lib/carbios/hostname.rb', line 6 def initialize ( hostname, = {} ) @hostname = hostname if [:base_hostname] @hostname.gsub!([:base_hostname], '') end end |
Instance Attribute Details
#hostname ⇒ Object (readonly)
Returns the value of attribute hostname.
4 5 6 |
# File 'lib/carbios/hostname.rb', line 4 def hostname @hostname end |
Instance Method Details
#reverse ⇒ Object
13 14 15 |
# File 'lib/carbios/hostname.rb', line 13 def reverse @hostname.split('.').reverse.join('.') end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/carbios/hostname.rb', line 17 def to_s @hostname end |