Class: Kodo::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/kodo/core/generator.rb

Constant Summary collapse

DEFAULT_ALGORITHM =
"md5"

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options=nil)
  self.algorithm = options.algorithm
  self.count = options.count
  self.max_length = options.max_length
end

Instance Attribute Details

#algorithmObject

Returns the value of attribute algorithm.



3
4
5
# File 'lib/kodo/core/generator.rb', line 3

def algorithm
  @algorithm
end

#countObject

Returns the value of attribute count.



3
4
5
# File 'lib/kodo/core/generator.rb', line 3

def count
  @count
end

#max_lengthObject

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

#runObject



53
54
55
56
# File 'lib/kodo/core/generator.rb', line 53

def run
  algorithm = @algorithm.new(@count, @max_length)
  algorithm.create
end