Class: Cipher

Inherits:
Object
  • Object
show all
Includes:
Generator, Validator, Version
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

Version::VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Validator

#validate

Methods included from Generator

#generate

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

#hasherObject

Returns the value of attribute hasher.



6
7
8
# File 'lib/cipher.rb', line 6

def hasher
  @hasher
end

#key_lengthObject

Returns the value of attribute key_length.



6
7
8
# File 'lib/cipher.rb', line 6

def key_length
  @key_length
end

#section_lengthObject

Returns the value of attribute section_length.



6
7
8
# File 'lib/cipher.rb', line 6

def section_length
  @section_length
end

#seperatorObject

Returns the value of attribute seperator.



6
7
8
# File 'lib/cipher.rb', line 6

def seperator
  @seperator
end