presents 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +7 -0
- data/README.txt +14 -3
- data/lib/presents.rb +1 -1
- metadata +1 -1
data/History.txt
CHANGED
data/README.txt
CHANGED
@@ -14,10 +14,21 @@ Minimalist presenter pattern for Rails
|
|
14
14
|
* Bulk up documentation.
|
15
15
|
|
16
16
|
== SYNOPSIS:
|
17
|
-
|
17
|
+
class Foo < ActiveRecord::Base
|
18
|
+
# has 'name' attribute
|
19
|
+
end
|
20
|
+
|
21
|
+
class FooPresenter < Presents::BasePresenter
|
22
|
+
presents :foo
|
23
|
+
|
24
|
+
def name
|
25
|
+
foo.name.upcase
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
18
29
|
- present @foo do |_foo|
|
19
|
-
= @foo.
|
20
|
-
= _foo.
|
30
|
+
= @foo.name # => 'My Name'
|
31
|
+
= _foo.name # => 'MY NAME'
|
21
32
|
|
22
33
|
== REQUIREMENTS:
|
23
34
|
|
data/lib/presents.rb
CHANGED