Class: HashIds::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



6
7
8
9
10
11
12
13
14
15
# File 'lib/hash_ids/configuration.rb', line 6

def initialize
  # the encrypted id length
  @min_hash_length = 16

  # the encrypting pool
  @alphabet        = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
  
  # secret
  @salt            = @alphabet
end

Instance Attribute Details

#alphabetObject

Returns the value of attribute alphabet.



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

def alphabet
  @alphabet
end

#min_hash_lengthObject

Returns the value of attribute min_hash_length.



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

def min_hash_length
  @min_hash_length
end

#saltObject

Returns the value of attribute salt.



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

def salt
  @salt
end