lib/rconf/configurator.rb in rconf-1.0.8 vs lib/rconf/configurator.rb in rconf-1.0.9

- old
+ new

@@ -70,9 +70,24 @@ :options => {} }] @all_settings << { :name => name, :description => description, :options => options || {} } true end + # Define code to be run whenever rconf gets updated. Acts as a getter and setter + # + # === Parameters + # val(Proc):: Code to run when rconf is updated + # + # === Return + # true:: The updater if no parameter is passed, true otherwise + def updater(val=nil) + if val + @updater = val + true + else + @updater + end + end end # Extend base class with ClassMethods module methods # # === Parameters