Sha256: b6e9097195852f8e101937ef0260252cd4a59a92702d6128e34254faa93ffcd2

Contents?: true

Size: 502 Bytes

Versions: 16

Compression:

Stored size: 502 Bytes

Contents

class NSData

  # converts an NSData instance into a base64 string.
  # @todo Support NSDataBase64EncodingOptions options - easy to add, but I want
  # to add specs, too, and a hash format (e.g. line_length: 64 =>
  # NSDataBase64Encoding64CharacterLineLength).
  def to_base64
    self.base64EncodedStringWithOptions(0)
  end

  # factory method to convert a base64 string into NSData.
  def self.from_base64(base64_data)
    NSData.alloc.initWithBase64EncodedData(base64_data, options: 0)
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
sugarcube-4.0.0 lib/cocoa/sugarcube-base64/nsdata.rb
sugarcube-3.5.0 lib/cocoa/sugarcube-base64/nsdata.rb
sugarcube-3.4.2 lib/cocoa/sugarcube-base64/nsdata.rb
sugarcube-3.4.1 lib/cocoa/sugarcube-base64/nsdata.rb
sugarcube-3.4.0 lib/cocoa/sugarcube-base64/nsdata.rb
sugarcube-3.3.7 lib/cocoa/sugarcube-base64/nsdata.rb
sugarcube-3.3.6 lib/cocoa/sugarcube-base64/nsdata.rb
sugarcube-3.3.5 lib/cocoa/sugarcube-base64/nsdata.rb
sugarcube-3.3.4 lib/cocoa/sugarcube-base64/nsdata.rb
sugarcube-3.3.3 lib/cocoa/sugarcube-base64/nsdata.rb
sugarcube-3.3.2 lib/cocoa/sugarcube-base64/nsdata.rb
sugarcube-3.3.1 lib/cocoa/sugarcube-base64/nsdata.rb
sugarcube-3.3.0 lib/cocoa/sugarcube-base64/nsdata.rb
sugarcube-3.2.0 lib/cocoa/sugarcube-base64/nsdata.rb
sugarcube-3.1.1 lib/cocoa/sugarcube-base64/nsdata.rb
sugarcube-3.1.0 lib/cocoa/sugarcube-base64/nsdata.rb