Class: Arpoon::Route
Defined Under Namespace
Classes: Entry
Constant Summary collapse
- Flags =
Bitmap.new( up: 0x0001, gateway: 0x0002, host: 0x0004, reinstate: 0x0008, dynamic: 0x0010, modified: 0x0020, mtu: 0x0040, window: 0x0080, irtt: 0x0100, reject: 0x0200, static: 0x0400, xresolve: 0x0800, no_forward: 0x1000, throw: 0x2000, no_pmt_udisc: 0x4000, default: 0x00010000, all_on_link: 0x00020000, addrconf: 0x00040000, linkrt: 0x00100000, no_next_hop: 0x00200000, cache: 0x01000000, flow: 0x02000000, policy: 0x0400000 )
Instance Method Summary collapse
- #each(device = nil) ⇒ Object
- #gateway_for(device) ⇒ Object
-
#initialize ⇒ Route
constructor
A new instance of Route.
Constructor Details
Instance Method Details
#each(device = nil) ⇒ Object
106 107 108 109 110 111 112 113 114 |
# File 'lib/arpoon/route.rb', line 106 def each (device = nil) return enum_for :each, device unless block_given? @entries.each {|entry| yield entry if !device || device.to_s == entry.device } self end |
#gateway_for(device) ⇒ Object
116 117 118 119 120 121 122 |
# File 'lib/arpoon/route.rb', line 116 def gateway_for (device) each(device) {|entry| return entry.gateway if entry.gateway? } nil end |