Class: Cipher
- Inherits:
-
Object
- Object
- Cipher
- Defined in:
- lib/cipher.rb,
lib/cipher/version.rb,
lib/cipher/generator.rb,
lib/cipher/validator.rb
Defined Under Namespace
Modules: Generator, Validator, Version
Constant Summary
Constants included from Version
Instance Attribute Summary collapse
-
#hasher ⇒ Object
Returns the value of attribute hasher.
-
#key_length ⇒ Object
Returns the value of attribute key_length.
-
#section_length ⇒ Object
Returns the value of attribute section_length.
-
#seperator ⇒ Object
Returns the value of attribute seperator.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Cipher
constructor
A new instance of Cipher.
Methods included from Validator
Methods included from Generator
Constructor Details
#initialize(args = {}) ⇒ Cipher
Returns a new instance of Cipher.
12 13 14 15 16 17 |
# File 'lib/cipher.rb', line 12 def initialize(args = {}) @key_length = args[:key_length] || 16 @section_length = args[:section_length] || 4 @seperator = args[:seperator] || '-' @hasher = args[:hasher] || 'sha1' end |
Instance Attribute Details
#hasher ⇒ Object
Returns the value of attribute hasher.
6 7 8 |
# File 'lib/cipher.rb', line 6 def hasher @hasher end |
#key_length ⇒ Object
Returns the value of attribute key_length.
6 7 8 |
# File 'lib/cipher.rb', line 6 def key_length @key_length end |
#section_length ⇒ Object
Returns the value of attribute section_length.
6 7 8 |
# File 'lib/cipher.rb', line 6 def section_length @section_length end |
#seperator ⇒ Object
Returns the value of attribute seperator.
6 7 8 |
# File 'lib/cipher.rb', line 6 def seperator @seperator end |