-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
35 lines (27 loc) · 707 Bytes
/
README
File metadata and controls
35 lines (27 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
YamlModel
=========
Declare your own YAML-based models by inheriting from YamlModel::Base.
Example
=======
class Book < YamlModel::Base
fields :title, :author, :content
end
Book.setup # creates the data file RAILS_ROOT/data/book.yml
Book.all # returns all records from book.yml
book = Book.first
puts book.title
puts book.author
puts book.content
Data file format (example)
==========================
-
title: the book about some thing
author: tim
content: bla bli blub
-
title: book with structured content
author: fronx
content:
chapter1: please read on in chapter 2.
chapter2: and now, move back to the top, please.
Copyright (c) 2008 François Wurmus, released under the MIT license