instance method restore_storable

Ruby on Rails 2.2.3

Since v2.2.3 Last seen in v2.2.3

Signature

restore_storable(filename)

Restores a data structure from a file. If restoring the data structure failed for any reason, nil will be returned.

filename

Name of the file belonging to the data structure.

Parameters

filename req
Source
# File activesupport/lib/active_support/vendor/xml-simple-1.0.11/xmlsimple.rb, line 41
    def restore_storable(filename)
      cache_file = get_cache_filename(filename)
      return nil unless File::exist?(cache_file)
      return nil unless File::mtime(cache_file).to_i > File::mtime(filename).to_i
      data = nil
      File.open(cache_file) { |f| data = Marshal.load(f) }
      data
    end

Defined in activesupport/lib/active_support/vendor/xml-simple-1.0.11/xmlsimple.rb line 41 · View on GitHub · Improve this page · Find usages on GitHub

Defined in XmlSimple::Cache

Type at least 2 characters to search.

↑↓ navigate · open · esc close