class SafeParams < SimpleDelegator
  def initialize(params = {})
    super(params)
    @params = params
  end

  def [](key)
    value = @params[key] rescue nil
    self.class.new value
  end

  delegate :__get_object__, to: :params
end
