Method: Edgarj::SearchForm::Operator#initialize

Defined in:
app/models/edgarj/search_form.rb

#initialize(attrs = {}) ⇒ Operator

accepts only allowed operators to avoid SQL injection



68
69
70
71
72
73
74
75
76
# File 'app/models/edgarj/search_form.rb', line 68

def initialize(attrs = {})
  @attrs = HashWithIndifferentAccess.new

  for k, v in (attrs || {}) do
    if ALLOWED[v]
      @attrs[k] = v
    end
  end
end