lib/icloud/session.rb
def parse_records(hash)
      [].tap do |records|
        hash.each do |name, hashes|
          if cls = record_class(name)
            hashes.each do |hsh|
              obj = cls.from_icloud(hsh)
              records.push(obj)
            end
          end
        end
      end
    end
#
# Internal: Parses a nested hash of records (as passed around by icloud.com)
# into a flat array of record instances, silently ignoring any unrecognized
# data.
#
# Examples
#
#   parse_records({
#     "Collection": [{ "guid": 123 }, { "guid": 456 }],
#     "Reminder":   [{ "guid": 789 }],
#     "Whatever":   [{ "junk": 1 }]
#   })
#
#   # => [<Collection:123>, <Collection:456>, <Reminder:789>]
#
Parses a nested hash of records (as passed around by icloud.com)
into a flat array of record instances, silently ignoring any unrecognized
data.

Examples




Parses a nested hash of records ( as passed around by icloud . com ) into a flat array of record instances silently ignoring any unrecognized data . Examples
def parse_records(hash)
      [].tap do |records|
        hash.each do |name, hashes|
          if cls = record_class(name)
            hashes.each do |hsh|
              obj = cls.from_icloud(hsh)
              records.push(obj)
            end
          end
        end
      end
    end
def parse_records ( hash ) [ ] . tap do | records | hash . each do | name , hashes | if cls = record_class ( name ) hashes . each do | hsh | obj = cls . from_icloud ( hsh ) records . push ( obj ) end end end end end
Internal: Parses a nested hash of records (as passed around by icloud.com)
into a flat array of record instances, silently ignoring any unrecognized
data.
Internal : Parses a nested hash of records ( as passed around by icloud . com ) into a flat array of record instances silently ignoring any unrecognized data .
hash