Class: NetworkDevices
- Inherits:
-
Object
- Object
- NetworkDevices
- Defined in:
- lib/networkwatcherd/networkdevices.rb
Instance Attribute Summary collapse
-
#ip_dn ⇒ Object
readonly
Returns the value of attribute ip_dn.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(ip) ⇒ NetworkDevices
constructor
A new instance of NetworkDevices.
- #inspect ⇒ Object
- #value ⇒ Object
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_dn ⇒ Object (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 |
#inspect ⇒ Object
7 8 9 |
# File 'lib/networkwatcherd/networkdevices.rb', line 7 def inspect @ip end |
#value ⇒ Object
10 11 12 |
# File 'lib/networkwatcherd/networkdevices.rb', line 10 def value @ip_dn end |