class Rambling::Trie::Serializers::Serializer
Base class for all serializers.
Public Instance Methods
dump(contents, filepath)
click to toggle source
Dumps contents into a specified filepath. @abstract Subclass and override {#dump} to output the desired format. @param [TContents] contents the contents to dump into given file. @param [String] filepath the filepath to dump the contents to. @return [Numeric] number of bytes written to disk.
# File lib/rambling/trie/serializers/serializer.rb, line 21 def dump contents, filepath raise NotImplementedError end
load(filepath)
click to toggle source
Loads contents from a specified filepath. @abstract Subclass and override {#load} to parse the desired format. @param [String] filepath the filepath to load contents from. @return [TContents] parsed contents from given file.
# File lib/rambling/trie/serializers/serializer.rb, line 12 def load filepath raise NotImplementedError end