Allow access to unset rtattrs to return nil
This commit is contained in:
@@ -164,7 +164,7 @@ module Netlink
|
|||||||
info = TYPE_INFO[type]
|
info = TYPE_INFO[type]
|
||||||
self::RTATTRS[code] = [name, info]
|
self::RTATTRS[code] = [name, info]
|
||||||
define_method name do
|
define_method name do
|
||||||
@attrs.fetch name
|
@attrs[name] # rtattrs are optional, non-existent returns nil
|
||||||
end
|
end
|
||||||
define_method "#{name}=" do |val|
|
define_method "#{name}=" do |val|
|
||||||
@attrs.store name, val
|
@attrs.store name, val
|
||||||
|
Reference in New Issue
Block a user