lib/rambling-trie.rb in rambling-trie-0.4.0 vs lib/rambling-trie.rb in rambling-trie-0.4.1
- old
+ new
@@ -1,22 +1,27 @@
[
- 'rambling',
- 'rambling-trie/invalid_operation',
- 'rambling-trie/children_hash_deferer',
- 'rambling-trie/compressor',
- 'rambling-trie/branches',
- 'rambling-trie/node',
- 'rambling-trie/root',
- 'rambling-trie/version'
-].each do |file|
- require File.join File.dirname(__FILE__), file
-end
+ 'invalid_operation',
+ 'children_hash_deferer',
+ 'compressor',
+ 'branches',
+ 'node',
+ 'root',
+ 'version'
+].map { |file| File.join('rambling-trie', file) }.each &method(:require)
module Rambling
module Trie
class << self
+ # Creates a new Trie. Entry point for the Rambling::Trie API.
+ # @param [String, nil] filename the file to load the words from (defaults to nil).
def create(*params)
Root.new *params
+ end
+
+ # @deprecated Please use {#create} instead
+ def new(*params)
+ warn '[DEPRECATION] `new` is deprecated. Please use `create` instead.'
+ create *params
end
end
end
end