module NumbersAndWords::Strategies::FiguresConverter::Decorators
Constants
- AVAILABLE
Public Class Methods
Source
# File lib/numbers_and_words/strategies/figures_converter/decorators.rb, line 23 def factory(strategy, options) enabled_decorator(options).new strategy, options end
Private Class Methods
Source
# File lib/numbers_and_words/strategies/figures_converter/decorators.rb, line 33 def decorator_class(method_name) method_name ? Object.const_get(decorator_class_name(method_name)) : Decorators::Base end
Source
# File lib/numbers_and_words/strategies/figures_converter/decorators.rb, line 37 def decorator_class_name(method_name) "#{name}::#{I18n.language_class_name}::#{method_name.to_s.split('_').collect(&:capitalize).join}" end
Source
# File lib/numbers_and_words/strategies/figures_converter/decorators.rb, line 29 def enabled_decorator(options) decorator_class AVAILABLE.reject { |name| options[name].nil? }.first end