Class: Plurimath::Formatter::Numbers::Base
- Inherits:
-
Object
- Object
- Plurimath::Formatter::Numbers::Base
- Defined in:
- lib/plurimath/formatter/numbers/base.rb
Direct Known Subclasses
Constant Summary collapse
- HEX_ALPHANUMERIC =
%w[0 1 2 3 4 5 6 7 8 9 a b c d e f].freeze
- DEFAULT_BASE =
10- DIGIT_VALUE =
HEX_ALPHANUMERIC.each_with_index.to_h
Instance Attribute Summary collapse
-
#base ⇒ Object
Returns the value of attribute base.
-
#symbols ⇒ Object
Returns the value of attribute symbols.
Instance Method Summary collapse
-
#initialize(symbols = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(symbols = {}) ⇒ Base
Returns a new instance of Base.
13 14 15 16 |
# File 'lib/plurimath/formatter/numbers/base.rb', line 13 def initialize(symbols = {}) @symbols = symbols @base = symbols[:base] || DEFAULT_BASE end |
Instance Attribute Details
#base ⇒ Object
Returns the value of attribute base.
11 12 13 |
# File 'lib/plurimath/formatter/numbers/base.rb', line 11 def base @base end |
#symbols ⇒ Object
Returns the value of attribute symbols.
11 12 13 |
# File 'lib/plurimath/formatter/numbers/base.rb', line 11 def symbols @symbols end |