Module: Chars

Defined in:
lib/chars/chars.rb,
lib/chars/version.rb,
lib/chars/char_set.rb,
lib/chars/string_enumerator.rb

Defined Under Namespace

Classes: CharSet, StringEnumerator

Constant Summary collapse

NUMERIC =

The numeric decimal character set

CharSet['0'..'9']
DIGITS =

See Also:

Since:

  • 0.3.0

NUMERIC
OCTAL =

The octal character set

CharSet['0'..'7']
UPPERCASE_HEXADECIMAL =

The upper-case hexadecimal character set

NUMERIC | CharSet['A'..'F']
LOWERCASE_HEXADECIMAL =

The lower-case hexadecimal character set

NUMERIC | CharSet['a'..'f']
HEXADECIMAL =

The hexadecimal character set

UPPERCASE_HEXADECIMAL | LOWERCASE_HEXADECIMAL
UPPERCASE_ALPHA =

The upper-case alpha character set

CharSet['A'..'Z']
LOWERCASE_ALPHA =

The lower-case alpha character set

CharSet['a'..'z']
ALPHA =

The alpha character set

UPPERCASE_ALPHA | LOWERCASE_ALPHA
ALPHA_NUMERIC =

The alpha-numeric character set

ALPHA | NUMERIC
PUNCTUATION =

The punctuation character set

CharSet['\'', '"', '`', ',', ';', ':', '~', '-',
'(', ')', '[', ']', '{', '}', '.', '?', '!']
SYMBOLS =

The symbolic character set

PUNCTUATION | CharSet[
  '@', '#', '$', '%', '^', '&', '*', '_', '+',
  '=', '|', '\\', '<', '>', '/'
]
WHITESPACE =

The space character set

Since:

  • 0.3.0

CharSet[' ', "\f", "\n", "\r", "\t", "\v"]
SPACE =
WHITESPACE
VISIBLE =

The set of printable characters (not including spaces)

ALPHA_NUMERIC | CharSet[
  '\'', '"', '`', ',', ';', ':', '~', '-',
  '(', ')', '[', ']', '{', '}', '.', '?', '!', '@', '#', '$',
  '%', '^', '&', '*', '_', '+', '=', '|', '\\', '<', '>', '/'
]
PRINTABLE =

The set of printable characters (including spaces)

ALPHA_NUMERIC | PUNCTUATION | SYMBOLS | CharSet[' ']
CONTROL =

The control-char character set

CharSet[0..0x1f, 0x7f]
SIGNED_ASCII =

The signed ASCII character set

CharSet[0..0x7f]
ASCII =

The full 8-bit character set

CharSet[0..0xff]
VERSION =

chars version

'0.3.3'

Class Method Summary collapse

Class Method Details

.alphaCharSet

The alphabetic character set.

Returns:

  • (CharSet)

    The alphabetic character set.

See Also:



181
182
183
# File 'lib/chars/chars.rb', line 181

def self.alpha
  ALPHA
end

.alpha_numericCharSet

The alpha-numeric character set.

Returns:

  • (CharSet)

    The alpha-numeric character set.

See Also:



193
194
195
# File 'lib/chars/chars.rb', line 193

def self.alpha_numeric
  ALPHA_NUMERIC
end

.asciiCharSet

The ASCII character set.

Returns:

  • (CharSet)

    The ASCII character set.

See Also:



302
303
304
# File 'lib/chars/chars.rb', line 302

def self.ascii
  ASCII
end

.controlCharSet

The control-character character set.

Returns:

  • (CharSet)

    The control-character character set.

See Also:



278
279
280
# File 'lib/chars/chars.rb', line 278

def self.control
  CONTROL
end

.digitsCharSet

Alias for numeric.

Returns:

  • (CharSet)

    The decimal-digit character set.

See Also:

Since:

  • 0.3.0



97
98
99
# File 'lib/chars/chars.rb', line 97

def self.digits
  numeric
end

.hexadecimalCharSet

The hexadecimal character set.

Returns:

  • (CharSet)

    The hexadecimal character set.

See Also:



145
146
147
# File 'lib/chars/chars.rb', line 145

def self.hexadecimal
  HEXADECIMAL
end

.lowercase_alphaCharSet

The lower-case alphabetic character set.

Returns:

  • (CharSet)

    The lower-case alphabetic character set.

See Also:



169
170
171
# File 'lib/chars/chars.rb', line 169

def self.lowercase_alpha
  LOWERCASE_ALPHA
end

.lowercase_hexadecimalCharSet

The lower-case hexadecimal character set.

Returns:

  • (CharSet)

    The lower-case hexadecimal character set.

See Also:



133
134
135
# File 'lib/chars/chars.rb', line 133

def self.lowercase_hexadecimal
  LOWERCASE_HEXADECIMAL
end

.numericCharSet

The decimal-digit character set.

Returns:

  • (CharSet)

    The decimal-digit character set.

See Also:



83
84
85
# File 'lib/chars/chars.rb', line 83

def self.numeric
  NUMERIC
end

.octalCharSet

The octal-digit character set.

Returns:

  • (CharSet)

    The octal-digit character set.

See Also:



109
110
111
# File 'lib/chars/chars.rb', line 109

def self.octal
  OCTAL
end

.printableCharSet

The set of printable characters, including spaces.

Returns:

  • (CharSet)

    The printable character set.

See Also:



266
267
268
# File 'lib/chars/chars.rb', line 266

def self.printable
  PRINTABLE
end

.punctuationCharSet

The punctuation character set.

Returns:

  • (CharSet)

    The punctuation character set.

See Also:



205
206
207
# File 'lib/chars/chars.rb', line 205

def self.punctuation
  PUNCTUATION
end

.signed_asciiCharSet

The signed ASCII character set.

Returns:

  • (CharSet)

    The signed ASCII character set.

See Also:



290
291
292
# File 'lib/chars/chars.rb', line 290

def self.signed_ascii
  SIGNED_ASCII
end

.spaceCharSet

The whitespace character set.

Returns:

See Also:

  • #whitespace


242
243
244
# File 'lib/chars/chars.rb', line 242

def self.space
  whitespace
end

.symbolsCharSet

The symbolic character set.

Returns:

  • (CharSet)

    The symbolic character set.

See Also:



217
218
219
# File 'lib/chars/chars.rb', line 217

def self.symbols
  SYMBOLS
end

.uppercase_alphaCharSet

The upper-case alphabetic character set.

Returns:

  • (CharSet)

    The upper-case alphabetic character set.

See Also:



157
158
159
# File 'lib/chars/chars.rb', line 157

def self.uppercase_alpha
  UPPERCASE_ALPHA
end

.uppercase_hexadecimalCharSet

The upper-case hexadecimal character set.

Returns:

  • (CharSet)

    The upper-case hexadecimal character set.

See Also:



121
122
123
# File 'lib/chars/chars.rb', line 121

def self.uppercase_hexadecimal
  UPPERCASE_HEXADECIMAL
end

.visibleCharSet

The set of printable characters, not including spaces.

Returns:

  • (CharSet)

    The visible character set.

See Also:



254
255
256
# File 'lib/chars/chars.rb', line 254

def self.visible
  VISIBLE
end

.whitespaceCharSet

The whitespace character set.

Returns:

  • (CharSet)

    The whitespace character set.

See Also:

Since:

  • 0.3.0



231
232
233
# File 'lib/chars/chars.rb', line 231

def self.whitespace
  WHITESPACE
end