Class: StrapiRuby::Formatter
- Inherits:
-
Object
- Object
- StrapiRuby::Formatter
- Defined in:
- lib/strapi_ruby/formatter.rb
Instance Method Summary collapse
- #call(data) ⇒ Object
-
#initialize(options = {}) ⇒ Formatter
constructor
A new instance of Formatter.
Constructor Details
#initialize(options = {}) ⇒ Formatter
Returns a new instance of Formatter.
3 4 5 |
# File 'lib/strapi_ruby/formatter.rb', line 3 def initialize( = {}) @keys_to_convert = [:convert_to_html] || StrapiRuby.config.convert_to_html end |
Instance Method Details
#call(data) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/strapi_ruby/formatter.rb', line 7 def call(data) # Check data for emptiness check_emptiness(data) converted_data = data.clone convert_to_html!(converted_data) convert_to_datetime!(converted_data) converted_data end |