Class: Kodo::Generator
- Inherits:
-
Object
- Object
- Kodo::Generator
- Defined in:
- lib/kodo/core/generator.rb
Constant Summary collapse
- DEFAULT_ALGORITHM =
"md5"
Instance Attribute Summary collapse
-
#algorithm ⇒ Object
Returns the value of attribute algorithm.
-
#count ⇒ Object
Returns the value of attribute count.
-
#max_length ⇒ Object
Returns the value of attribute max_length.
Instance Method Summary collapse
-
#initialize(options = nil) ⇒ Generator
constructor
A new instance of Generator.
- #run ⇒ Object
Constructor Details
#initialize(options = nil) ⇒ Generator
Returns a new instance of Generator.
7 8 9 10 11 |
# File 'lib/kodo/core/generator.rb', line 7 def initialize(=nil) self.algorithm = .algorithm self.count = .count self.max_length = .max_length end |
Instance Attribute Details
#algorithm ⇒ Object
Returns the value of attribute algorithm.
3 4 5 |
# File 'lib/kodo/core/generator.rb', line 3 def algorithm @algorithm end |
#count ⇒ Object
Returns the value of attribute count.
3 4 5 |
# File 'lib/kodo/core/generator.rb', line 3 def count @count end |
#max_length ⇒ Object
Returns the value of attribute max_length.
3 4 5 |
# File 'lib/kodo/core/generator.rb', line 3 def max_length @max_length end |
Instance Method Details
#run ⇒ Object
53 54 55 56 |
# File 'lib/kodo/core/generator.rb', line 53 def run algorithm = @algorithm.new(@count, @max_length) algorithm.create end |