kind_dom 0.9.4 → 0.9.5
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/lib/kind_dom/base.rb +7 -6
- metadata +1 -1
data/lib/kind_dom/base.rb
CHANGED
@@ -12,20 +12,21 @@ module KindDom
|
|
12
12
|
# The original libxml behavior of the parsed document is preserved.
|
13
13
|
#
|
14
14
|
# As a contrived example, in the controller:
|
15
|
-
# @results = KindDom.new(xml_data)
|
15
|
+
# @results = KindDom::Base.new(xml_data)
|
16
16
|
#
|
17
17
|
# In the view:
|
18
18
|
#
|
19
19
|
# <% @results.first_of('//item') do |item| -%>
|
20
20
|
# <p>(This block is only executed if `item` is found.)</p>
|
21
21
|
#
|
22
|
-
# <% item.content_for('title') do |
|
23
|
-
# <h2><%=h
|
24
|
-
# <p>(This
|
22
|
+
# <% item.content_for('title', '(Untitled)') do |content| -%>
|
23
|
+
# <h2><%=h content %></h2>
|
24
|
+
# <p>(This header will show "(Untitled)" if `title` is blank or not found.)</p>
|
25
25
|
# <% end -%>
|
26
26
|
#
|
27
|
-
# <% item.content_for('description') do |
|
28
|
-
# <p><%=
|
27
|
+
# <% item.content_for('description') do |content| -%>
|
28
|
+
# <p><%= item.content_for('@updated_at') {|date| "<em>#{date}</em> -- " } %>
|
29
|
+
# <%=h content %></p>
|
29
30
|
# <p>(This block is only executed if `description` has content.)</p>
|
30
31
|
# <% end -%>
|
31
32
|
# <% end -%>
|