Class: TortoiseLabs::IP

Inherits:
Object
  • Object
show all
Defined in:
lib/tortoiselabs/vps.rb

Overview

IPs

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#broadcastObject (readonly)

Returns the value of attribute broadcast.



6
7
8
# File 'lib/tortoiselabs/vps.rb', line 6

def broadcast
  @broadcast
end

#gatewayObject (readonly)

Returns the value of attribute gateway.



6
7
8
# File 'lib/tortoiselabs/vps.rb', line 6

def gateway
  @gateway
end

#ipObject (readonly)

Returns the value of attribute ip.



6
7
8
# File 'lib/tortoiselabs/vps.rb', line 6

def ip
  @ip
end

#netmaskObject (readonly)

Returns the value of attribute netmask.



6
7
8
# File 'lib/tortoiselabs/vps.rb', line 6

def netmask
  @netmask
end

#networkObject (readonly)

Returns the value of attribute network.



6
7
8
# File 'lib/tortoiselabs/vps.rb', line 6

def network
  @network
end

#versionObject (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_sObject



16
17
18
# File 'lib/tortoiselabs/vps.rb', line 16

def to_s
  @ip
end