Class: Blueprinter::AutoExtractor Private

Inherits:
Extractor
  • Object
show all
Defined in:
lib/blueprinter/extractors/auto_extractor.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Methods inherited from Extractor

extract, #initialize

Constructor Details

This class inherits a constructor from Blueprinter::Extractor

Instance Method Details

#extract(field_name, object, local_options, options = {}) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



3
4
5
6
7
# File 'lib/blueprinter/extractors/auto_extractor.rb', line 3

def extract(field_name, object, local_options, options = {})
  extractor = object.is_a?(Hash) ? HashExtractor : PublicSendExtractor
  extraction = extractor.extract(field_name, object, local_options, options)
  options.key?(:datetime_format) ? format_datetime(extraction, options[:datetime_format]) : extraction
end