-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Milestone
Description
Now that the gem can serialize in-memory tries into disk and back, let's add the ability for people to configure them. Someone using the gem should be able to configure the available serializers, the default serializer, etc. I'm thinking an API like this:
require 'rambling-trie'
Rambling::Trie.config do |c|
c.serializers.add :json, MyJsonSerializer.new
c.serializers.default = c.serializers[:yml]
end
# Load a trie from disk and do things with it...
Also, the way Readers are configured and treated in general should be very similar to what would be done with Serializers. That way, you could also provide your own readers for getting a list of words from disk (or any IO, really):
require 'rambling-trie'
Rambling::Trie.config do |c|
c.readers.add :html, MyHtmlReader.new
c.readers.default = c.readers[:html]
end
# Create a trie and do things with it...
Reactions are currently unavailable