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. :reek:TooManyInstanceVariables { max_instance_variables: 5 }

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:



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

def compressor
  @compressor
end

#readersProviderCollection<Readers::Reader>

The configured Readers.

Returns:



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

def readers
  @readers
end

#root_builderProc<Nodes::Node>

The configured ‘root_builder`, which returns a Node when called.

Returns:

  • (Proc<Nodes::Node>)

    the configured ‘root_builder`.



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

def root_builder
  @root_builder
end

#serializersProviderCollection<Serializers::Serializer>

The configured Serializers.

Returns:



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

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

#resetvoid

This method returns an undefined value.

Resets back to default properties.



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

def reset
  reset_readers
  reset_serializers

  @compressor = Rambling::Trie::Compressor.new
  @root_builder = -> { Rambling::Trie::Nodes::Raw.new }
  @tmp_path = Dir.tmpdir
end