Class: FractionalIndexer::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/fractional_indexer/configuration.rb

Constant Summary collapse

DIGITS_LIST =

allow only ASCII characters

{
  base_10: ("0".."9").to_a,
  base_62: ("0".."9").to_a + ("A".."Z").to_a + ("a".."z").to_a,
  base_94: ("!".."~").to_a,
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#base=(value) ⇒ Object

Sets the attribute base

Parameters:

  • value

    the value to set the attribute base to.



5
6
7
# File 'lib/fractional_indexer/configuration.rb', line 5

def base=(value)
  @base = value
end

Instance Method Details

#digitsObject



14
15
16
# File 'lib/fractional_indexer/configuration.rb', line 14

def digits
  DIGITS_LIST[base] || DIGITS_LIST[:base_62]
end