Class: Presenting::Search::FieldSet

Inherits:
Array
  • Object
show all
Defined in:
lib/presenting/search.rb

Instance Method Summary collapse

Instance Method Details

#<<(val) ⇒ Object



70
71
72
73
74
75
76
77
78
79
# File 'lib/presenting/search.rb', line 70

def <<(val)
  if val.is_a? Hash
    k, v = *val.to_a.first
    opts = v.is_a?(Hash) ? v : {:pattern => v}
    opts[:name] = k
  else
    opts = {:name => val}
  end
  super Field.new(opts)
end