Permalink
Browse files

Rename "render_on" to "render!"

  • Loading branch information...
1 parent 03bf164 commit f10ee609c4c6520f5fb74abbc9c2b2cf492f0652 @mneumann committed Jan 6, 2010
Showing with 15 additions and 15 deletions.
  1. +1 −1 README.rdoc
  2. +9 −9 lib/wee/decoration.rb
  3. +1 −1 lib/wee/presenter.rb
  4. +2 −2 lib/wee/renderer.rb
  5. +1 −1 lib/wee/session.rb
  6. +1 −1 test/bm_render.rb
View
@@ -102,7 +102,7 @@ The request/response cycle in Wee is actually split into two separate phases.
The rendering phase is assumed to be side-effect free! So, you as a programmer
should take care to meet this assumption. Rendering is performed by method
-Wee::Component#render_on.
+Wee::Component#render!.
=== Action Phase (Invoking Callbacks)
View
@@ -4,15 +4,15 @@ module Wee
#
# Abstract base class of all decorations. Forwards the methods
- # #process_callbacks, #render_on and #state to the next decoration in
+ # #process_callbacks, #render! and #state to the next decoration in
# the chain. Subclasses should provide special behaviour in these methods,
# otherwise the decoration does not make sense.
#
# For example, a HeaderFooterDecoration class could draw a header and footer
# around the decorations or components below itself:
#
# class HeaderFooterDecoration < Wee::Decoration
- # alias render_on render_presenter_on
+ # alias render! render_presenter!
# def render(r)
# r.text "header"
# r.render_decoration(@next)
@@ -47,12 +47,12 @@ def process_callbacks(callbacks)
@next.process_callbacks(callbacks)
end
- alias render_presenter_on render_on
+ alias render_presenter! render!
#
# Forwards method call to the next decoration in the chain.
#
- def render_on(r)
- @next.render_on(r)
+ def render!(r)
+ @next.render!(r)
end
#
@@ -71,7 +71,7 @@ def state(s)
#
# A Wee::Delegate breaks the decoration chain and forwards the methods
- # #process_callbacks, #render_on and #state to the corresponding *chain*
+ # #process_callbacks, #render! and #state to the corresponding *chain*
# method of it's _delegate_ component (a Wee::Component).
#
class Delegate < Decoration
@@ -92,8 +92,8 @@ def process_callbacks(callbacks)
# Forwards method to the corresponding top-level *chain* method of the
# _delegate_ component.
#
- def render_on(r)
- @delegate.decoration.render_on(r)
+ def render!(r)
+ @delegate.decoration.render!(r)
end
#
@@ -159,7 +159,7 @@ def process_callbacks(callbacks)
class WrapperDecoration < Decoration
- alias render_on render_presenter_on
+ alias render! render_presenter!
#
# Overwrite this method, and call render_inner(r)
View
@@ -9,7 +9,7 @@ module Wee
#
class Presenter
- def render_on(r)
+ def render!(r)
r.with(self) {|new_r| render(new_r)}
end
View
@@ -50,14 +50,14 @@ def with(component)
def render(component)
close
self.callbacks.unregister(component)
- component.decoration.render_on(self)
+ component.decoration.render!(self)
nil
end
def render_decoration(decoration)
close
self.callbacks.unregister(decoration)
- decoration.render_on(self)
+ decoration.render!(self)
nil
end
View
@@ -286,7 +286,7 @@ def render(request, page)
r.callbacks = Wee::Callbacks.new
begin
- @root_component.decoration.render_on(r)
+ @root_component.decoration.render!(r)
r.close
r.response << r.document.to_s
rescue AbortProcessing => abort
View
@@ -26,7 +26,7 @@ def join
r.callbacks = Wee::Callbacks.new
begin
- root_component.decoration.render_on(r)
+ root_component.decoration.render!(r)
ensure
r.close
end

0 comments on commit f10ee60

Please sign in to comment.