Class: IntegerHash::Configuration
- Inherits:
-
Object
- Object
- IntegerHash::Configuration
- Defined in:
- lib/integer_hash/configuration.rb
Instance Attribute Summary collapse
-
#inverse_integer ⇒ Object
Returns the value of attribute inverse_integer.
-
#max_integer ⇒ Object
Returns the value of attribute max_integer.
-
#prime ⇒ Object
Returns the value of attribute prime.
-
#random_integer ⇒ Object
Returns the value of attribute random_integer.
Instance Method Summary collapse
-
#initialize(values = {}) ⇒ Configuration
constructor
A new instance of Configuration.
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_integer ⇒ Object
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_integer ⇒ Object
Returns the value of attribute max_integer.
6 7 8 |
# File 'lib/integer_hash/configuration.rb', line 6 def max_integer @max_integer end |
#prime ⇒ Object
Returns the value of attribute prime.
3 4 5 |
# File 'lib/integer_hash/configuration.rb', line 3 def prime @prime end |
#random_integer ⇒ Object
Returns the value of attribute random_integer.
5 6 7 |
# File 'lib/integer_hash/configuration.rb', line 5 def random_integer @random_integer end |