Sha256: 5fa281d7978a48f58dc52df48bf083c4ebfa85b82b5b275426e0d737d0ea9e5c

Contents?: true

Size: 477 Bytes

Versions: 38

Compression:

Stored size: 477 Bytes

Contents

# Reopens the NSUserDefaults class to add Array like accessors
# @see https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/nsuserdefaults_Class/Reference/Reference.html
class NSUserDefaults

  # Retrieves the object for the passed key
  def [](key)
    self.objectForKey(key.to_s)
  end

  # Sets the value for a given key and save it right away.
  def []=(key, val)
    self.setObject(val, forKey: key.to_s)
    self.synchronize
  end
end

Version data entries

38 entries across 38 versions & 2 rubygems

Version Path
bubble-wrap-1.9.7 motion/core/ns_user_defaults.rb
bubble-wrap-1.9.6 motion/core/ns_user_defaults.rb
PackingPeanut-1.2.0 lib/PackingPeanut-ios/ns_user_defaults.rb
bubble-wrap-1.9.5 motion/core/ns_user_defaults.rb
bubble-wrap-1.9.4 motion/core/ns_user_defaults.rb
bubble-wrap-1.9.3 motion/core/ns_user_defaults.rb
bubble-wrap-1.9.2 motion/core/ns_user_defaults.rb
bubble-wrap-1.9.1 motion/core/ns_user_defaults.rb
bubble-wrap-1.9.0 motion/core/ns_user_defaults.rb
PackingPeanut-1.1.0 lib/PackingPeanut-ios/ns_user_defaults.rb
PackingPeanut-1.0.0 lib/PackingPeanut-ios/ns_user_defaults.rb
bubble-wrap-1.8.0 motion/core/ns_user_defaults.rb
bubble-wrap-1.7.1 motion/core/ns_user_defaults.rb
bubble-wrap-1.7.0 motion/core/ns_user_defaults.rb
bubble-wrap-1.6.0 motion/core/ns_user_defaults.rb
bubble-wrap-1.6.0.rc1 motion/core/ns_user_defaults.rb
bubble-wrap-1.5.0 motion/core/ns_user_defaults.rb
bubble-wrap-1.5.0.rc1 motion/core/ns_user_defaults.rb
bubble-wrap-1.4.0 motion/core/ns_user_defaults.rb
bubble-wrap-1.3.0 motion/core/ns_user_defaults.rb