`user_agent` should be an `attr_writer` (not `attr_accessor`), since the reader method is defined below.