Class: LexoRanker::Ranker::CharacterSpace
- Inherits:
-
Object
- Object
- LexoRanker::Ranker::CharacterSpace
show all
- Defined in:
- lib/lexoranker/ranker.rb
Defined Under Namespace
Classes: CharNotInCharacterSpaceError, EmptyCharacterSpaceError, IndexOutOfCharacterSpaceError
Constant Summary
collapse
- CHARACTERS =
[*"0".."9", *"A".."Z", *"a".."z"].sort.freeze
Class Method Summary
collapse
Class Method Details
.ord(char) ⇒ Integer
248
249
250
251
|
# File 'lib/lexoranker/ranker.rb', line 248
def ord(char)
CHARACTERS.index(char) || (raise CharNotInCharacterSpaceError,
"Character: #{char} not found in current character space")
end
|
.size ⇒ Object
271
272
273
|
# File 'lib/lexoranker/ranker.rb', line 271
def size
CHARACTERS.size
end
|