---
title: "Ruby面试系列四，新鲜刚出炉的面试题"
author: "夜鸣猪"
date: "2011-10-13T04:47:49Z"
tags: []
categories: ["编程语言"]
slug: "ruby"
draft: false
lastmod: "2011-10-21T00:27:13Z"
id: 1192498
url: "https://hlee.iteye.com/blog/1192498"
---

这次是留的家庭作业


> 
> Write a model (ActiveRecord-based, or similar pattern) for storing
> configuration settings.
> 
> Each setting should have a unique identifier such as a name, and
> should hold a single value. For example: an email address used to send
> error emails, or a boolean flag to enable/disable a particular
> feature. It must be possible to store values of at least these 4
> types: string, integer, float and boolean.
> 
> The purpose of this exercise is to show your code design skills.
> Therefore, the model's interface for reading and writing configuration
> values must be simple and convenient. It should be possible to read
> and write specific values, versus reading and writing all the
> configuration settings all at once. The model should come with unit
> tests and database migrations, or whatever is required given your
> persistent storage setup.
> 
> Bonus: add caching so that values don't need to be read from the
> database every time they are accessed. If using Ruby on Rails,
> consider  using standard Rails caching techniques for this. HTML
> caching should not be required.
> 


这个个加分的缓存是说啥呢