Module: CodeGenerator

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

Defined Under Namespace

Modules: Tokenify Classes: ClassNotFoundError, FieldNotSpecifiedError, Generator, ScopeNotSpecifiedError

Constant Summary collapse

VERSION =
"0.0.4".freeze
LOWER_ALPHA =
('a'..'z').to_a
UPPER_ALPHA =
('A'..'Z').to_a
NUMERIC =
(0..9).to_a
ALPHA =
LOWER_ALPHA + UPPER_ALPHA
LOWER_ALPHA_NUMERIC =
LOWER_ALPHA + NUMERIC
UPPER_ALPHA_NUMERIC =
UPPER_ALPHA + NUMERIC
ALPHA_NUMERIC =
ALPHA + NUMERIC
@@length =
10
@@use_chars =
:alpha_numeric
@@include_chars =
Array.new
@@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



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

def configure
  yield self
end

.valid_charactersObject



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

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