Module: CodeGenerator

Defined in:
lib/code_generator/version.rb,
lib/code_generator/configure.rb,
lib/code_generator/generator.rb

Defined Under Namespace

Classes: ClassNotFoundError, FieldNotSpecifiedError, Generator, ScopeNotSpecifiedError

Constant Summary collapse

VERSION =
"0.0.3".freeze
LOWER_ALPHA =
('a'..'z').to_a
UPPER_ALPHA =
('A'..'Z').to_a
ALPHA =
LOWER_ALPHA + UPPER_ALPHA
NUMERIC =
(0..9).to_a
LOWER_ALPHA_NUMERIC =
LOWER_ALPHA + NUMERIC
UPPER_ALPHA_NUMERIC =
UPPER_ALPHA + NUMERIC
ALPHA_NUMERIC =
ALPHA + NUMERIC
@@length =
10
@@use_chars =
:alpha_numeric
@@include_chars =
nil
@@invalid_chars =
Array.new
@@repeat_chars =
true

Class Method Summary collapse

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (CodeGenerator)

    the object that the method was called on



29
30
31
# File 'lib/code_generator/configure.rb', line 29

def configure
  yield self
end

.valid_charactersObject



33
34
35
36
37
38
39
# File 'lib/code_generator/configure.rb', line 33

def valid_characters
  return @@valid_chars if @@valid_chars
  _chars    = "CodeGenerator::#{use_chars.upcase}".constantize
  _chars   |=  include_chars unless include_chars.empty?
  _invalid  = invalid_chars
  @@valid_chars = _chars - _invalid
end