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.



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

def initialize
  reset
end

Instance Attribute Details

#compressorCompressor

The configured Compressor.

Returns:



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

def compressor
  @compressor
end

#readersProviderCollection<Readers::Reader>

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 returns a Node when called.

Returns:

  • (Proc<Nodes::Node>)

    the configured ‘root_builder`.



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

def root_builder
  @root_builder
end

#serializersProviderCollection<Serializers::Serializer>

The configured Serializers.

Returns:



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

def serializers
  @serializers
end

#tmp_pathString

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

Returns:

  • (String)

    the configured ‘tmp_path`.



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

def tmp_path
  @tmp_path
end

Instance Method Details

#resetvoid

This method returns an undefined value.

Resets back to default properties.



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

def reset
  reset_readers
  reset_serializers

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