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.
-
#override_to_param ⇒ Object
Returns the value of attribute override_to_param.
-
#pepper ⇒ Object
Returns the value of attribute pepper.
-
#salt ⇒ Object
Returns the value of attribute salt.
-
#sign_hashids ⇒ Object
Returns the value of attribute sign_hashids.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #to_args ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/hashid/rails/configuration.rb', line 14 def initialize @salt = "" @pepper = "" @min_hash_length = 6 @alphabet = "abcdefghijklmnopqrstuvwxyz" \ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \ "1234567890" @override_find = true @override_to_param = true @sign_hashids = true end |
Instance Attribute Details
#alphabet ⇒ Object
Returns the value of attribute alphabet.
6 7 8 |
# File 'lib/hashid/rails/configuration.rb', line 6 def alphabet @alphabet end |
#min_hash_length ⇒ Object
Returns the value of attribute min_hash_length.
6 7 8 |
# File 'lib/hashid/rails/configuration.rb', line 6 def min_hash_length @min_hash_length end |
#override_find ⇒ Object
Returns the value of attribute override_find.
6 7 8 |
# File 'lib/hashid/rails/configuration.rb', line 6 def override_find @override_find end |
#override_to_param ⇒ Object
Returns the value of attribute override_to_param.
6 7 8 |
# File 'lib/hashid/rails/configuration.rb', line 6 def override_to_param @override_to_param end |
#pepper ⇒ Object
Returns the value of attribute pepper.
6 7 8 |
# File 'lib/hashid/rails/configuration.rb', line 6 def pepper @pepper end |
#salt ⇒ Object
Returns the value of attribute salt.
6 7 8 |
# File 'lib/hashid/rails/configuration.rb', line 6 def salt @salt end |
#sign_hashids ⇒ Object
Returns the value of attribute sign_hashids.
6 7 8 |
# File 'lib/hashid/rails/configuration.rb', line 6 def sign_hashids @sign_hashids end |
Instance Method Details
#to_args ⇒ Object
26 27 28 |
# File 'lib/hashid/rails/configuration.rb', line 26 def to_args ["#{pepper}#{salt}", min_hash_length, alphabet] end |