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 | SPACE
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.0'

Class Method Summary collapse

Class Method Details

.alphaCharSet

The alphabetic character set.

Returns:

  • (CharSet)

    The alphabetic character set.

See Also:



175
176
177
# File 'lib/chars/chars.rb', line 175

def self.alpha
  ALPHA
end

.alpha_numericCharSet

The alpha-numeric character set.

Returns:

  • (CharSet)

    The alpha-numeric character set.

See Also:



187
188
189
# File 'lib/chars/chars.rb', line 187

def self.alpha_numeric
  ALPHA_NUMERIC
end

.asciiCharSet

The ASCII character set.

Returns:

  • (CharSet)

    The ASCII character set.

See Also:



294
295
296
# File 'lib/chars/chars.rb', line 294

def self.ascii
  ASCII
end

.controlCharSet

The control-character character set.

Returns:

  • (CharSet)

    The control-character character set.

See Also:



270
271
272
# File 'lib/chars/chars.rb', line 270

def self.control
  CONTROL
end

.digitsObject

See Also:

Since:

  • 0.3.0



91
92
93
# File 'lib/chars/chars.rb', line 91

def self.digits
  numeric
end

.hexadecimalCharSet

The hexadecimal character set.

Returns:

  • (CharSet)

    The hexadecimal character set.

See Also:



139
140
141
# File 'lib/chars/chars.rb', line 139

def self.hexadecimal
  HEXADECIMAL
end

.lowercase_alphaCharSet

The lower-case alphabetic character set.

Returns:

  • (CharSet)

    The lower-case alphabetic character set.

See Also:



163
164
165
# File 'lib/chars/chars.rb', line 163

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:



127
128
129
# File 'lib/chars/chars.rb', line 127

def self.lowercase_hexadecimal
  LOWERCASE_HEXADECIMAL
end

.numericCharSet

The decimal-digit character set.

Returns:

  • (CharSet)

    The decimal-digit character set.

See Also:



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

def self.numeric
  NUMERIC
end

.octalCharSet

The octal-digit character set.

Returns:

  • (CharSet)

    The octal-digit character set.

See Also:



103
104
105
# File 'lib/chars/chars.rb', line 103

def self.octal
  OCTAL
end

.printableCharSet

The set of printable characters, including spaces.

Returns:

  • (CharSet)

    The printable character set.

See Also:



258
259
260
# File 'lib/chars/chars.rb', line 258

def self.printable
  PRINTABLE
end

.punctuationCharSet

The punctuation character set.

Returns:

  • (CharSet)

    The punctuation character set.

See Also:



199
200
201
# File 'lib/chars/chars.rb', line 199

def self.punctuation
  PUNCTUATION
end

.signed_asciiCharSet

The signed ASCII character set.

Returns:

  • (CharSet)

    The signed ASCII character set.

See Also:



282
283
284
# File 'lib/chars/chars.rb', line 282

def self.signed_ascii
  SIGNED_ASCII
end

.spaceObject

The whitespace character set.

See Also:

  • #whitespace


234
235
236
# File 'lib/chars/chars.rb', line 234

def self.space
  whitespace
end

.symbolsCharSet

The symbolic character set.

Returns:

  • (CharSet)

    The symbolic character set.

See Also:



211
212
213
# File 'lib/chars/chars.rb', line 211

def self.symbols
  SYMBOLS
end

.uppercase_alphaCharSet

The upper-case alphabetic character set.

Returns:

  • (CharSet)

    The upper-case alphabetic character set.

See Also:



151
152
153
# File 'lib/chars/chars.rb', line 151

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:



115
116
117
# File 'lib/chars/chars.rb', line 115

def self.uppercase_hexadecimal
  UPPERCASE_HEXADECIMAL
end

.visibleCharSet

The set of printable characters, not including spaces.

Returns:

  • (CharSet)

    The visible character set.

See Also:



246
247
248
# File 'lib/chars/chars.rb', line 246

def self.visible
  VISIBLE
end

.whitespaceCharSet

The whitespace character set.

Returns:

  • (CharSet)

    The whitespace character set.

See Also:

Since:

  • 0.3.0



225
226
227
# File 'lib/chars/chars.rb', line 225

def self.whitespace
  WHITESPACE
end