Factor out list/filter code

This commit is contained in:
Brian Candler
2011-05-03 16:54:05 +01:00
parent 9d920ce4e8
commit bdd75c611c
6 changed files with 96 additions and 86 deletions

View File

@@ -1,14 +1,11 @@
require 'netlink/route'
require 'netlink/route/handler'
module Netlink
module Route
class VlanHandler
def initialize(rtsocket = Netlink::Route::Socket.new)
@rtsocket = rtsocket
end
def index(v)
@rtsocket.index(v)
class VlanHandler < Handler
def clear_cache
# No cache
end
def list(filter={}, &blk)