Sha256: 655c87670ad37ebbdf5967e1fa161bdb842ce8323a2ed05618f49d8b7b1d691e

Contents?: true

Size: 1.33 KB

Versions: 132

Compression:

Stored size: 1.33 KB

Contents

class NSCoder

  def [] key
    return self.decodeObjectForKey key
  end

  def []= key, value
    return self.encodeObject(value, forKey:key)
  end

  def bool(key)
    return self.decodeBoolForKey(key)
  end

  def double(key)
    return self.decodeDoubleForKey(key)
  end

  def float(key)
    return self.decodeFloatForKey(key)
  end

  def int(key)
    return self.decodeIntegerForKey(key)
  end

  def point(key)
    return CGPointFromString(self.decodeObjectForKey(key))
  end

  def rect(key)
    return CGRectFromString(self.decodeObjectForKey(key))
  end

  def size(key)
    return CGSizeFromString(self.decodeObjectForKey(key))
  end

  def set(key, toBool:value)
    self.encodeBool(value, forKey:key)
    return self
  end

  def set(key, toDouble:value)
    self.encodeDouble(value, forKey:key)
    return self
  end

  def set(key, toFloat:value)
    self.encodeFloat(value, forKey:key)
    return self
  end

  def set(key, toInt:value)
    self.encodeInteger(value, forKey:key)
    return self
  end

  def set(key, toPoint:value)
    self.encodeObject(NSStringFromCGPoint(value), forKey:key)
    return self
  end

  def set(key, toRect:value)
    self.encodeObject(NSStringFromCGRect(value), forKey:key)
    return self
  end

  def set(key, toSize:value)
    self.encodeObject(NSStringFromCGSize(value), forKey:key)
    return self
  end

end

Version data entries

132 entries across 132 versions & 1 rubygems

Version Path
sugarcube-2.8.2 lib/cocoa/sugarcube-nscoder/nscoder.rb
sugarcube-2.8.1 lib/cocoa/sugarcube-nscoder/nscoder.rb
sugarcube-2.8.0 lib/cocoa/sugarcube-nscoder/nscoder.rb
sugarcube-2.7.1 lib/cocoa/sugarcube-nscoder/nscoder.rb
sugarcube-2.7.0 lib/cocoa/sugarcube-nscoder/nscoder.rb
sugarcube-2.6.0 lib/cocoa/sugarcube-nscoder/nscoder.rb
sugarcube-2.5.0 lib/cocoa/sugarcube-nscoder/nscoder.rb
sugarcube-2.4.2 lib/cocoa/sugarcube-nscoder/nscoder.rb
sugarcube-2.4.1 lib/cocoa/sugarcube-nscoder/nscoder.rb
sugarcube-2.4.0 lib/cocoa/sugarcube-nscoder/nscoder.rb
sugarcube-2.3.0 lib/cocoa/sugarcube-nscoder/nscoder.rb
sugarcube-2.2.0 lib/cocoa/sugarcube-nscoder/nscoder.rb
sugarcube-2.1.5 lib/cocoa/sugarcube-nscoder/nscoder.rb
sugarcube-2.1.4 lib/cocoa/sugarcube-nscoder/nscoder.rb
sugarcube-2.1.3 lib/cocoa/sugarcube-nscoder/nscoder.rb
sugarcube-2.1.2 lib/cocoa/sugarcube-nscoder/nscoder.rb
sugarcube-2.1.1 lib/cocoa/sugarcube-nscoder/nscoder.rb
sugarcube-2.1.0 lib/cocoa/sugarcube-nscoder/nscoder.rb
sugarcube-2.0.2 lib/cocoa/sugarcube-nscoder/nscoder.rb
sugarcube-2.0.1 lib/cocoa/sugarcube-nscoder/nscoder.rb