Class: Solrizer::FieldMapper::DataTypeMappingBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/solrizer/field_mapper.rb

Instance Method Summary collapse

Constructor Details

#initialize(index_type_mapping) ⇒ DataTypeMappingBuilder

Returns a new instance of DataTypeMappingBuilder.



314
315
316
# File 'lib/solrizer/field_mapper.rb', line 314

def initialize(index_type_mapping)
  @index_type_mapping = index_type_mapping
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



318
319
320
321
322
# File 'lib/solrizer/field_mapper.rb', line 318

def method_missing(method, *args, &block)
  data_type_mapping = (@index_type_mapping.data_types[method] ||= DataTypeMapping.new)
  data_type_mapping.opts.merge! args[0] if args.length > 0
  data_type_mapping.converter = block if block_given?
end