README.md in easy_presenter-1.0.1 vs README.md in easy_presenter-1.1.0
- old
+ new
@@ -1,8 +1,8 @@
-# EasyPresenter
+# EasyPresenter [![Build Status](https://travis-ci.org/s12chung/easy_presenter.png?branch=master)](https://travis-ci.org/s12chung/easy_presenter?branch=master) [![Code Climate](https://codeclimate.com/github/s12chung/easy_presenter.png)](https://codeclimate.com/github/s12chung/easy_presenter)
-Access view methods from the context of your `Ruby on Rails` model.
+Access view methods from model instances in `Ruby on Rails`.
## Usage
### Easy
```
gem 'easy_presenter'
@@ -24,12 +24,11 @@
# Using a module, so you must do this to add class methods
module ClassMethods
# String of all full names separated by commas
def full_names
- # better to access `User` this way, you may use `User` instead of `self.class` though.
- self.class.all.map(&:full_name).join(", ")
+ all.map(&:full_name).join(", ")
end
end
end
```
@@ -55,12 +54,11 @@
`ActiveRecord`, `Mongoid`, you may add support to an ORM at the bottom of `lib/easy_presenter.rb` and send in a pull request if you wish.
### Advanced
You may `include` the following modules to add EasyPresenter to other classes.
-* `easy_presenter_subclass` - for handling subclasses
* `EasyPresenter::Base` - add access to view methods
-* `EasyPresenter` - `EasyPresenter::Base` and if `method_missing?`, give access to the `ClassNamePresenter` class
+* `EasyPresenter` - Give access to the `ClassNamePresenter` class that has access to view methods. Subclasses will also have the same effect.
To add access to view methods to all instances or subclasses (such as an ORM).
```ruby
# config/initializers/add_presenter_to_orm.rb
\ No newline at end of file