Module: Bases
- Defined in:
- lib/bases.rb,
lib/bases/version.rb,
lib/bases/constants.rb
Overview
The main module.
Defined Under Namespace
Modules: Algorithms, Helpers Classes: Number
Constant Summary collapse
- VERSION =
The version of the Bases gem.
'1.0.2'- B62 =
Base 62, the alphanumeric characters.
( ('A'..'Z').to_a + ('a'..'z').to_a + (0..9).to_a ).map(&:to_s)
- B64 =
Base 64.
B62 + %w(+ /)
- InvalidValueError =
This error is thrown when an invalid value is passed to
Number's constructor. Class.new(StandardError)
- NoBaseSpecifiedError =
This error is thrown when you try to convert a number without a specified base to another base.
Class.new(StandardError)
- WrongDigitsError =
This error is thrown when there are digits in a value which aren't in the specified source base.
Class.new(StandardError)
- DuplicateDigitsError =
This error is thrown when there are duplicates digits in a base.
Class.new(StandardError)
Class Method Summary collapse
-
.val(value) ⇒ Number
(also: [])
Create a new instance of
Numberfromvalue.