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.0.0 lib/cocoa/sugarcube-nscoder/nscoder.rb
sugarcube-1.7.0 lib/sugarcube-nscoder/nscoder.rb
sugarcube-1.6.3 lib/sugarcube-nscoder/nscoder.rb
sugarcube-1.6.2 lib/sugarcube-nscoder/nscoder.rb
sugarcube-1.6.1 lib/sugarcube-nscoder/nscoder.rb
sugarcube-1.6.0 lib/sugarcube-nscoder/nscoder.rb
sugarcube-1.5.9 lib/sugarcube-nscoder/nscoder.rb
sugarcube-1.5.8 lib/sugarcube-nscoder/nscoder.rb
sugarcube-1.5.7 lib/sugarcube-nscoder/nscoder.rb
sugarcube-1.5.6 lib/sugarcube-nscoder/nscoder.rb
sugarcube-1.5.5 lib/sugarcube-nscoder/nscoder.rb
sugarcube-1.5.4 lib/sugarcube-nscoder/nscoder.rb
sugarcube-1.5.3 lib/sugarcube-nscoder/nscoder.rb
sugarcube-1.5.2 lib/sugarcube-nscoder/nscoder.rb
sugarcube-1.5.1 lib/sugarcube-nscoder/nscoder.rb
sugarcube-1.5.0 lib/sugarcube-nscoder/nscoder.rb
sugarcube-1.4.6 lib/sugarcube-nscoder/nscoder.rb
sugarcube-1.4.5 lib/sugarcube-nscoder/nscoder.rb
sugarcube-1.4.4 lib/sugarcube-nscoder/nscoder.rb
sugarcube-1.4.3 lib/sugarcube-nscoder/nscoder.rb