Class: TortoiseLabs::IP
- Inherits:
-
Object
- Object
- TortoiseLabs::IP
- Defined in:
- lib/tortoiselabs/vps.rb
Overview
IPs
Instance Attribute Summary collapse
-
#broadcast ⇒ Object
readonly
Returns the value of attribute broadcast.
-
#gateway ⇒ Object
readonly
Returns the value of attribute gateway.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#netmask ⇒ Object
readonly
Returns the value of attribute netmask.
-
#network ⇒ Object
readonly
Returns the value of attribute network.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(iphash) ⇒ IP
constructor
A new instance of IP.
- #to_s ⇒ Object
Constructor Details
#initialize(iphash) ⇒ IP
Returns a new instance of IP.
8 9 10 11 12 13 14 |
# File 'lib/tortoiselabs/vps.rb', line 8 def initialize(iphash) @ip = iphash["ip"] ipnet = iphash["ipnet"] @netmask, @broadcast, @version, @gateway, @network = ipnet["netmask"], ipnet["broadcast"], ipnet["version"].to_i, ipnet["gateway"], ipnet["network"] end |
Instance Attribute Details
#broadcast ⇒ Object (readonly)
Returns the value of attribute broadcast.
6 7 8 |
# File 'lib/tortoiselabs/vps.rb', line 6 def broadcast @broadcast end |
#gateway ⇒ Object (readonly)
Returns the value of attribute gateway.
6 7 8 |
# File 'lib/tortoiselabs/vps.rb', line 6 def gateway @gateway end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
6 7 8 |
# File 'lib/tortoiselabs/vps.rb', line 6 def ip @ip end |
#netmask ⇒ Object (readonly)
Returns the value of attribute netmask.
6 7 8 |
# File 'lib/tortoiselabs/vps.rb', line 6 def netmask @netmask end |
#network ⇒ Object (readonly)
Returns the value of attribute network.
6 7 8 |
# File 'lib/tortoiselabs/vps.rb', line 6 def network @network end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
6 7 8 |
# File 'lib/tortoiselabs/vps.rb', line 6 def version @version end |
Instance Method Details
#to_s ⇒ Object
16 17 18 |
# File 'lib/tortoiselabs/vps.rb', line 16 def to_s @ip end |