author | Alberto Bertogli
<albertito@gmail.com> 2007-06-29 13:26:18 UTC |
committer | Alberto Bertogli
<albertito@gmail.com> 2007-06-29 13:26:18 UTC |
parent | f54d724a47ee6673fee016913eee3261988665e9 |
bindings/ruby/nmdb.rb | +5 | -3 |
diff --git a/bindings/ruby/nmdb.rb b/bindings/ruby/nmdb.rb index 608a55f..a47c0a0 100644 --- a/bindings/ruby/nmdb.rb +++ b/bindings/ruby/nmdb.rb @@ -9,11 +9,13 @@ end class GenericDB - attr_writer :automarshal + attr_accessor :automarshal + attr_accessor :default - def initialize() + def initialize(default = nil) @db = Nmdb_ll::DB.new @automarshal = true + @default = default end def add_tipc_server(port = -1) @@ -66,7 +68,7 @@ class GenericDB return r elsif r == -1 then # key not in the database - return nil + return @default elsif r <= 2 then raise NetworkException else