Sha256: cc7e912019570912c7bff9f777f46cf01122710a546e391284503b364e016002

Contents?: true

Size: 599 Bytes

Versions: 6

Compression:

Stored size: 599 Bytes

Contents

class NSCoder

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

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

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

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

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

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

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sugarcube-4.0.0 lib/ios/sugarcube-nscoder/nscoder.rb
sugarcube-3.5.0 lib/ios/sugarcube-nscoder/nscoder.rb
sugarcube-3.4.2 lib/ios/sugarcube-nscoder/nscoder.rb
sugarcube-3.4.1 lib/ios/sugarcube-nscoder/nscoder.rb
sugarcube-3.4.0 lib/ios/sugarcube-nscoder/nscoder.rb
sugarcube-3.3.7 lib/ios/sugarcube-nscoder/nscoder.rb