Module: Flex::Result::DocumentLoader::ModelClasses
Instance Method Summary collapse
-
#map ⇒ Object
maps all the index/types to the ruby class.
Instance Method Details
#map ⇒ Object
maps all the index/types to the ruby class
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/flex/result/document_loader.rb', line 17 def map @map ||= begin map = {} (Conf.flex_models + Conf.flex_active_models).each do |m| m = eval("::#{m}") if m.is_a?(String) indices = m.flex.index.is_a?(Array) ? m.flex.index : [m.flex.index] types = m.flex.type.is_a?(Array) ? m.flex.type : [m.flex.type] indices.each do |i| types.each { |t| map["#{i}/#{t}"] = m } end end map end end |