Class: Rambling::Trie::Configuration::Properties

Inherits:
Object
  • Object
show all
Defined in:
lib/rambling/trie/configuration/properties.rb

Overview

Provides configurable properties for Rambling::Trie.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeProperties

Returns a new properties instance.



32
33
34
# File 'lib/rambling/trie/configuration/properties.rb', line 32

def initialize
  reset
end

Instance Attribute Details

#compressorCompressor

The configured Compressor.

Returns:



20
21
22
# File 'lib/rambling/trie/configuration/properties.rb', line 20

def compressor
  @compressor
end

#readersProviderCollection

The configured Readers.

Returns:



11
12
13
# File 'lib/rambling/trie/configuration/properties.rb', line 11

def readers
  @readers
end

#root_builderProc<Nodes::Node>

The configured root_builder, which should return a Node

when called.

Returns:



25
26
27
# File 'lib/rambling/trie/configuration/properties.rb', line 25

def root_builder
  @root_builder
end

#serializersProviderCollection

The configured Serializers.

Returns:



16
17
18
# File 'lib/rambling/trie/configuration/properties.rb', line 16

def serializers
  @serializers
end

#tmp_pathString

The configured tmp_path, which will be used for throwaway files.

Returns:

  • (String)

    the configured tmp_path.



29
30
31
# File 'lib/rambling/trie/configuration/properties.rb', line 29

def tmp_path
  @tmp_path
end

Instance Method Details

#resetObject

Resets back to default properties.



37
38
39
40
41
42
43
44
# File 'lib/rambling/trie/configuration/properties.rb', line 37

def reset
  reset_readers
  reset_serializers

  @compressor = Rambling::Trie::Compressor.new
  @root_builder = -> { Rambling::Trie::Nodes::Raw.new }
  @tmp_path = '/tmp'
end