lib/sugarcube/defaults.rb in sugarcube-0.1.6 vs lib/sugarcube/defaults.rb in sugarcube-0.2.0
- old
+ new
@@ -1,21 +1,15 @@
-
class Symbol
def get_default
NSUserDefaults.standardUserDefaults.objectForKey(self)
end
- def remove_default
- NSUserDefaults.standardUserDefaults.removeObjectForKey(self)
+ def set_default val
+ NSUserDefaults.standardUserDefaults.setObject(val, forKey:self)
end
-end
-
-
-class Object
-
- def save_to_default(key)
- NSUserDefaults.standardUserDefaults.setObject(self, forKey:key)
+ def remove_default
+ NSUserDefaults.standardUserDefaults.removeObjectForKey(self)
end
end