Class: NetworkDevices

Inherits:
Object
  • Object
show all
Defined in:
lib/networkwatcherd/networkdevices.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ip) ⇒ NetworkDevices

Returns a new instance of NetworkDevices.



3
4
5
6
# File 'lib/networkwatcherd/networkdevices.rb', line 3

def initialize (ip)
  @ip = ip
  @ip_dn = @ip.split(".").at(3).to_i
end

Instance Attribute Details

#ip_dnObject (readonly)

Returns the value of attribute ip_dn.



2
3
4
# File 'lib/networkwatcherd/networkdevices.rb', line 2

def ip_dn
  @ip_dn
end

Instance Method Details

#<=>(other) ⇒ Object



13
14
15
# File 'lib/networkwatcherd/networkdevices.rb', line 13

def <=> (other)
  @ip_dn <=> other.ip_dn
end

#inspectObject



7
8
9
# File 'lib/networkwatcherd/networkdevices.rb', line 7

def inspect
  @ip
end

#valueObject



10
11
12
# File 'lib/networkwatcherd/networkdevices.rb', line 10

def value
  @ip_dn
end