Class: IntegerHash::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(values = {}) ⇒ Configuration

Returns a new instance of Configuration.



8
9
10
11
12
13
# File 'lib/integer_hash/configuration.rb', line 8

def initialize values = {}
  @prime = values[:prime]
  @inverse_integer = values[:inverse_integer]
  @random_integer = values[:random_integer]
  @max_integer = 2**(values[:size] || 31)-1
end

Instance Attribute Details

#inverse_integerObject

Returns the value of attribute inverse_integer.



4
5
6
# File 'lib/integer_hash/configuration.rb', line 4

def inverse_integer
  @inverse_integer
end

#max_integerObject

Returns the value of attribute max_integer.



6
7
8
# File 'lib/integer_hash/configuration.rb', line 6

def max_integer
  @max_integer
end

#primeObject

Returns the value of attribute prime.



3
4
5
# File 'lib/integer_hash/configuration.rb', line 3

def prime
  @prime
end

#random_integerObject

Returns the value of attribute random_integer.



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

def random_integer
  @random_integer
end