Sha256: e9fffce4f4c4a537267aed9b1e5a01d412d8459846bfc707c38d0472dbdf006a

Contents?: true

Size: 483 Bytes

Versions: 31

Compression:

Stored size: 483 Bytes

Contents

class NSData

  # converts NSData into an NSString using any encoding, default is UTF8
  # @return [NSString]
  def nsstring(encoding=nil)
    if encoding
      return NSString.stringWithCString(self.bytes, encoding:encoding)
    else

      return NSString.stringWithUTF8String(self)
    end
  end

  # @return [UIImage]
  def uiimage(scale=nil)
    if scale
      return UIImage.imageWithData(self, scale:scale)
    else
      return UIImage.imageWithData(self)
    end
  end

end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
sugarcube-0.20.5 lib/sugarcube/nsdata.rb
sugarcube-0.20.4 lib/sugarcube/nsdata.rb
sugarcube-0.20.3 lib/sugarcube/nsdata.rb
sugarcube-0.20.1 lib/sugarcube/nsdata.rb
sugarcube-0.20.0 lib/sugarcube/nsdata.rb
sugarcube-0.19.5 lib/sugarcube/nsdata.rb
sugarcube-0.19.4 lib/sugarcube/nsdata.rb
sugarcube-0.19.2 lib/sugarcube/nsdata.rb
sugarcube-0.19.0 lib/sugarcube/nsdata.rb
sugarcube-0.18.21 lib/sugarcube/nsdata.rb
sugarcube-0.18.20 lib/sugarcube/nsdata.rb
sugarcube-0.18.19 lib/sugarcube/nsdata.rb
sugarcube-0.18.18 lib/sugarcube/nsdata.rb
sugarcube-0.18.17 lib/sugarcube/nsdata.rb
sugarcube-0.18.16 lib/sugarcube/nsdata.rb
sugarcube-0.18.12 lib/sugarcube/nsdata.rb
sugarcube-0.18.11 lib/sugarcube/nsdata.rb
sugarcube-0.18.10 lib/sugarcube/nsdata.rb
sugarcube-0.18.9 lib/sugarcube/nsdata.rb
sugarcube-0.18.8 lib/sugarcube/nsdata.rb