Class: Plurimath::Configuration
- Inherits:
-
Object
- Object
- Plurimath::Configuration
- Defined in:
- lib/plurimath/configuration.rb
Constant Summary collapse
- DEFAULT_DECIMAL =
"."- DEFAULT_MAX_ITERATIONS =
Cap on bounded sum/prod iterations, guarding the untrusted-document evaluation path against runaway loops. Set to nil to disable the cap.
100_000
Instance Attribute Summary collapse
-
#evaluation_max_iterations ⇒ Object
Returns the value of attribute evaluation_max_iterations.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#number_formatter ⇒ Object
Returns the value of attribute number_formatter.
Instance Method Summary collapse
- #decimal ⇒ Object
- #deprecation ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
13 14 15 |
# File 'lib/plurimath/configuration.rb', line 13 def initialize @evaluation_max_iterations = DEFAULT_MAX_ITERATIONS end |
Instance Attribute Details
#evaluation_max_iterations ⇒ Object
Returns the value of attribute evaluation_max_iterations.
11 12 13 |
# File 'lib/plurimath/configuration.rb', line 11 def evaluation_max_iterations @evaluation_max_iterations end |
#locale ⇒ Object
Returns the value of attribute locale.
11 12 13 |
# File 'lib/plurimath/configuration.rb', line 11 def locale @locale end |
#number_formatter ⇒ Object
Returns the value of attribute number_formatter.
11 12 13 |
# File 'lib/plurimath/configuration.rb', line 11 def number_formatter @number_formatter end |
Instance Method Details
#decimal ⇒ Object
21 22 23 |
# File 'lib/plurimath/configuration.rb', line 21 def decimal Formatter::SupportedLocales.decimal_for(locale, default: DEFAULT_DECIMAL) end |
#deprecation ⇒ Object
17 18 19 |
# File 'lib/plurimath/configuration.rb', line 17 def deprecation Deprecation end |