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.



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

def initialize
  reset
end

Instance Attribute Details

#compressorCompressor

The configured Compressor.

Returns:



18
19
20
# File 'lib/rambling/trie/configuration/properties.rb', line 18

def compressor
  @compressor
end

#readersProviderCollection<Readers::Reader>

The configured Readers.

Returns:



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

def readers
  @readers
end

#root_builderProc<Nodes::Node>

The configured root_builder, which returns a Node when called.

Returns:



22
23
24
# File 'lib/rambling/trie/configuration/properties.rb', line 22

def root_builder
  @root_builder
end

#serializersProviderCollection<Serializers::Serializer>

The configured Serializers.

Returns:



14
15
16
# File 'lib/rambling/trie/configuration/properties.rb', line 14

def serializers
  @serializers
end

#tmp_pathString

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

Returns:

  • (String)

    the configured tmp_path.



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

def tmp_path
  @tmp_path
end

Instance Method Details

#resetvoid

This method returns an undefined value.

Resets back to default properties.



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

def reset
  reset_readers
  reset_serializers

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