Sha256: dd58d6150f9ff15bf3fab542a52ac5bef4d4560833a4110464c56495c3f21aca

Contents?: true

Size: 531 Bytes

Versions: 55

Compression:

Stored size: 531 Bytes

Contents

class NSArray

  class << self

    def read_from(path_or_url)
      case path_or_url
      when NSURL
        self.arrayWithContentsOfURL(path_or_url)
      when NSString
        self.arrayWithContentsOfFile(path_or_url)
      else
        false
      end
    end

  end

  def write_to(path_or_url, atomically=true)
    case path_or_url
    when NSURL
      self.writeToURL(path_or_url, atomically: atomically)
    when NSString
      self.writeToFile(path_or_url, atomically: atomically)
    else
      false
    end
  end

end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
sugarcube-3.0.4 lib/cocoa/sugarcube-files/nsarray.rb
sugarcube-3.0.3 lib/cocoa/sugarcube-files/nsarray.rb
sugarcube-3.0.2 lib/cocoa/sugarcube-files/nsarray.rb
sugarcube-3.0.1 lib/cocoa/sugarcube-files/nsarray.rb
sugarcube-3.0.0 lib/cocoa/sugarcube-files/nsarray.rb
sugarcube-2.12.3 lib/cocoa/sugarcube-files/nsarray.rb
sugarcube-2.12.2 lib/cocoa/sugarcube-files/nsarray.rb
sugarcube-2.12.1 lib/cocoa/sugarcube-files/nsarray.rb
sugarcube-2.12.0 lib/cocoa/sugarcube-files/nsarray.rb
sugarcube-2.11.1 lib/cocoa/sugarcube-files/nsarray.rb
sugarcube-2.11.0 lib/cocoa/sugarcube-files/nsarray.rb
sugarcube-2.10.0 lib/cocoa/sugarcube-files/nsarray.rb
sugarcube-2.9.1 lib/cocoa/sugarcube-files/nsarray.rb
sugarcube-2.8.2 lib/cocoa/sugarcube-files/nsarray.rb
sugarcube-2.8.1 lib/cocoa/sugarcube-files/nsarray.rb
sugarcube-2.8.0 lib/cocoa/sugarcube-files/nsarray.rb
sugarcube-2.7.1 lib/cocoa/sugarcube-files/nsarray.rb
sugarcube-2.7.0 lib/cocoa/sugarcube-files/nsarray.rb
sugarcube-2.6.0 lib/cocoa/sugarcube-files/nsarray.rb
sugarcube-2.5.0 lib/cocoa/sugarcube-files/nsarray.rb