Class: Generator
- Inherits:
-
Object
- Object
- Generator
- Defined in:
- lib/generator.rb
Instance Attribute Summary collapse
-
#available_chars ⇒ Object
Returns the value of attribute available_chars.
Instance Method Summary collapse
- #generate(options) ⇒ Object
-
#initialize ⇒ Generator
constructor
A new instance of Generator.
Constructor Details
#initialize ⇒ Generator
Returns a new instance of Generator.
6 7 8 9 10 11 12 |
# File 'lib/generator.rb', line 6 def initialize self.available_chars = { lower_upper: ('a'..'z').to_a + ('A'..'Z').to_a, numbers: ('0'..'9').to_a, special_chars: ('!'..'/').to_a } end |
Instance Attribute Details
#available_chars ⇒ Object
Returns the value of attribute available_chars.
4 5 6 |
# File 'lib/generator.rb', line 4 def available_chars @available_chars end |
Instance Method Details
#generate(options) ⇒ Object
14 15 16 |
# File 'lib/generator.rb', line 14 def generate() random_password end |