Skip to content

Commit

Permalink
Fix warning.
Browse files Browse the repository at this point in the history
With '$VERBOSE = true', '@foo = {} unless @foo' warns about uninitialized instance variable
  • Loading branch information
ytti committed Nov 17, 2011
1 parent 9e6403e commit f09b160
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/snmp/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class << self
attr_reader :alternates

def option(symbol, alternate, defaulter=nil)
@alternates = {} unless @alternates
@alternates ||= {}
@alternates[symbol] = alternate
define_method(symbol) do
alternate_symbol = self.class.alternates[symbol]
Expand Down

0 comments on commit f09b160

Please sign in to comment.