Class: ToDecimal::Base
- Inherits:
-
Object
- Object
- ToDecimal::Base
- Defined in:
- lib/to_decimal/base_class.rb
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
Instance Method Summary collapse
- #[](input) ⇒ Object
-
#initialize(base) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(base) ⇒ Base
Returns a new instance of Base.
9 10 11 12 13 |
# File 'lib/to_decimal/base_class.rb', line 9 def initialize(base) validate_base(base) @base = base freeze end |
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
7 8 9 |
# File 'lib/to_decimal/base_class.rb', line 7 def base @base end |
Instance Method Details
#[](input) ⇒ Object
15 16 17 18 19 |
# File 'lib/to_decimal/base_class.rb', line 15 def [](input) validate_input(input) convert(input) end |