Skip to content

Commit

Permalink
added some documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Falkén committed Apr 2, 2014
1 parent a123e5b commit 939f3a0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ArtDeco

TODO: Write a gem description
Implements the decorator design pattern by wrapping your models and adding decorative methods.

## Installation

Expand All @@ -18,7 +18,17 @@ Or install it yourself as:

## Usage

TODO: Write usage instructions here
To create a decorator for your User model, create a file `app/decorators/user_decorator.rb`

Then declare the class UserDecorator and let it inherit from ArtDeco::Decorator

class UserDecorator < ArtDeco::Decorator
end

Now you can wrap your model in the decorator to add functionality without breaking the single responsibility pattern.

user = User.find(params[:id])
@user = UserDecorator.new(user)

## Contributing

Expand Down

0 comments on commit 939f3a0

Please sign in to comment.