Sha256: b96bc5c7dc376de455a237e41c500edc39167e2a68b5fe27929989497ff6a02c

Contents?: true

Size: 546 Bytes

Versions: 55

Compression:

Stored size: 546 Bytes

Contents

class NSDictionary

  class << self

    def read_from(path_or_url)
      case path_or_url
      when NSURL
        self.dictionaryWithContentsOfURL(path_or_url)
      when NSString
        self.dictionaryWithContentsOfFile(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-2.4.2 lib/cocoa/sugarcube-files/nsdictionary.rb
sugarcube-2.4.1 lib/cocoa/sugarcube-files/nsdictionary.rb
sugarcube-2.4.0 lib/cocoa/sugarcube-files/nsdictionary.rb
sugarcube-2.3.0 lib/cocoa/sugarcube-files/nsdictionary.rb
sugarcube-2.2.0 lib/cocoa/sugarcube-files/nsdictionary.rb
sugarcube-2.1.5 lib/cocoa/sugarcube-files/nsdictionary.rb
sugarcube-2.1.4 lib/cocoa/sugarcube-files/nsdictionary.rb
sugarcube-2.1.3 lib/cocoa/sugarcube-files/nsdictionary.rb
sugarcube-2.1.2 lib/cocoa/sugarcube-files/nsdictionary.rb
sugarcube-2.1.1 lib/cocoa/sugarcube-files/nsdictionary.rb
sugarcube-2.1.0 lib/cocoa/sugarcube-files/nsdictionary.rb
sugarcube-2.0.2 lib/cocoa/sugarcube-files/nsdictionary.rb
sugarcube-2.0.1 lib/cocoa/sugarcube-files/nsdictionary.rb
sugarcube-2.0.0 lib/cocoa/sugarcube-files/nsdictionary.rb
sugarcube-1.7.0 lib/sugarcube-files/nsdictionary.rb