def dump
      if !File.exist?(self.class.namespace(model.class, model.service))
        self.class.create_namespace(model.class, model.service)
      end

      data = { :identity => model.identity,
                     :model_klass => model.class.to_s,
                     :collection_klass => model.collection && model.collection.class.to_s,
                     :attrs => model.attributes }

      File.open(dump_to, "w") { |f| f.write(YAML.dump(data)) }
    end
def dump
      if !File.exist?(self.class.namespace(model.class, model.service))
        self.class.create_namespace(model.class, model.service)
      end

      data = { :identity => model.identity,
                     :model_klass => model.class.to_s,
                     :collection_klass => model.collection && model.collection.class.to_s,
                     :attrs => model.attributes }

      File.open(dump_to, "w") { |f| f.write(YAML.dump(data)) }
    end
Dump a Fog::Model resource. Every fog model/instance now has a +cache+ method/object injected in.
 as such you can use the #dump method to save the attributes and metadata of that instance as cache
 which can be re-used in some other session.