Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Share the immutable love in the README

  • Loading branch information...
commit 9004b6c679f98f3e7e8d04da97d57b34d0a19be7 1 parent 6bb6c40
@jamesottaway jamesottaway authored
Showing with 22 additions and 0 deletions.
  1. +22 −0 README.markdown
View
22 README.markdown
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.