查看网站首页
查看网站首页
查看 sitemap.xml
✏️ 正在编辑: cdesc-Marshal.yaml
路径:
/opt/alt/ruby18/share/ri/1.8/system/Marshal/cdesc-Marshal.yaml
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
--- !ruby/object:RI::ClassDescription attributes: [] class_methods: - !ruby/object:RI::MethodSummary name: dump - !ruby/object:RI::MethodSummary name: load - !ruby/object:RI::MethodSummary name: restore comment: - !ruby/struct:SM::Flow::P body: The marshaling library converts collections of Ruby objects into a byte stream, allowing them to be stored outside the currently active script. This data may subsequently be read and the original objects reconstituted. Marshaled data has major and minor version numbers stored along with the object information. In normal use, marshaling can only load data written with the same major version number and an equal or lower minor version number. If Ruby's ``verbose'' flag is set (normally using -d, -v, -w, or --verbose) the major and minor numbers must match exactly. Marshal versioning is independent of Ruby's version numbers. You can extract the version by reading the first two bytes of marshaled data. - !ruby/struct:SM::Flow::VERB body: " str = Marshal.dump("thing")\n RUBY_VERSION #=> "1.8.0"\n str[0] #=> 4\n str[1] #=> 8\n" - !ruby/struct:SM::Flow::P body: "Some objects cannot be dumped: if the objects to be dumped include bindings, procedure or method objects, instances of class IO, or singleton objects, a TypeError will be raised. If your class has special serialization needs (for example, if you want to serialize in some specific format), or if it contains objects that would otherwise not be serializable, you can implement your own serialization strategy by defining two methods, _dump and _load: The instance method _dump should return a String object containing all the information necessary to reconstitute objects of this class and all referenced objects up to a maximum depth given as an integer parameter (a value of -1 implies that you should disable depth checking). The class method _load should take a String and return an object of this class." constants: - !ruby/object:RI::Constant comment: name: MAJOR_VERSION value: INT2FIX(MARSHAL_MAJOR) - !ruby/object:RI::Constant comment: name: MINOR_VERSION value: INT2FIX(MARSHAL_MINOR) full_name: Marshal includes: [] instance_methods: [] name: Marshal superclass:
💾 保存文件
← 返回文件管理器