Class: Hashid::Rails::Configuration
- Inherits:
-
Object
- Object
- Hashid::Rails::Configuration
- Defined in:
- lib/hashid/rails/configuration.rb
Instance Attribute Summary collapse
-
#alphabet ⇒ Object
Returns the value of attribute alphabet.
-
#min_hash_length ⇒ Object
Returns the value of attribute min_hash_length.
-
#override_find ⇒ Object
Returns the value of attribute override_find.
-
#salt ⇒ Object
Returns the value of attribute salt.
Instance Method Summary collapse
- #for_table(table_name) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
6 7 8 9 10 11 12 13 |
# File 'lib/hashid/rails/configuration.rb', line 6 def initialize @salt = "" @min_hash_length = 6 @alphabet = "abcdefghijklmnopqrstuvwxyz" \ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \ "1234567890" @override_find = true end |
Instance Attribute Details
#alphabet ⇒ Object
Returns the value of attribute alphabet.
4 5 6 |
# File 'lib/hashid/rails/configuration.rb', line 4 def alphabet @alphabet end |
#min_hash_length ⇒ Object
Returns the value of attribute min_hash_length.
4 5 6 |
# File 'lib/hashid/rails/configuration.rb', line 4 def min_hash_length @min_hash_length end |
#override_find ⇒ Object
Returns the value of attribute override_find.
4 5 6 |
# File 'lib/hashid/rails/configuration.rb', line 4 def override_find @override_find end |
#salt ⇒ Object
Returns the value of attribute salt.
4 5 6 |
# File 'lib/hashid/rails/configuration.rb', line 4 def salt @salt end |
Instance Method Details
#for_table(table_name) ⇒ Object
15 16 17 |
# File 'lib/hashid/rails/configuration.rb', line 15 def for_table(table_name) ["#{table_name}#{salt}", min_hash_length, alphabet] end |