Permalink
Browse files

Share the immutable love in the README

  • Loading branch information...
1 parent 6bb6c40 commit 9004b6c679f98f3e7e8d04da97d57b34d0a19be7 James Ottaway committed Aug 2, 2012
Showing with 22 additions and 0 deletions.
  1. +22 −0 README.markdown
View
@@ -201,6 +201,28 @@ You can blueprint the Post class just like anything else:
And `Post.make` will construct a new Post.
+### Immutable Objects
+
+You don't need to expose writer methods for the attributes you wish to leverage in the blueprint.
+
+For example:
+
+ class Post
+ extend Machinist::Machinable
+
+ attr_reader :title
+ attr_reader :body
+ end
+
+The blueprint above will still work:
+
+ Post.blueprint do
+ title { "A title!" }
+ body { "A body!" }
+ end
+
+And `Post.make` will still construct a new Post.
+
### Other Tricks

0 comments on commit 9004b6c

Please sign in to comment.