Class: Plurimath::Formatter::Numbers::Base
- Inherits:
-
Object
- Object
- Plurimath::Formatter::Numbers::Base
- Defined in:
- lib/plurimath/formatter/numbers/base.rb
Overview
Shared base for formatter helpers that need resolved options, target base state, and common digit operations.
Direct Known Subclasses
Constant Summary collapse
- HEX_DIGITS =
"abcdef"- 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.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(options) ⇒ Base
Returns a new instance of Base.
16 17 18 19 |
# File 'lib/plurimath/formatter/numbers/base.rb', line 16 def initialize() @options = @base = @options.base end |
Instance Attribute Details
#base ⇒ Object
Returns the value of attribute base.
14 15 16 |
# File 'lib/plurimath/formatter/numbers/base.rb', line 14 def base @base end |
#options ⇒ Object
Returns the value of attribute options.
14 15 16 |
# File 'lib/plurimath/formatter/numbers/base.rb', line 14 def @options end |