Skip to content
This repository has been archived by the owner on Dec 25, 2020. It is now read-only.

Commit

Permalink
* Component#add_decoration returns now self. Example where this is
Browse files Browse the repository at this point in the history
	  useful:

	    app = Wee::Utils.app_for {
	      HelloWorld.new.add_decoration(Wee::PageDecoration.new("Hello World"))
	    }
  • Loading branch information
mneumann committed Jan 27, 2005
1 parent 144cae3 commit dba6789
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
@@ -1,5 +1,12 @@
Thu Jan 27 15:23:59 CET 2005 Michael Neumann <mneumann@ntecs.de>

* Component#add_decoration returns now self. Example where this is
useful:

app = Wee::Utils.app_for {
HelloWorld.new.add_decoration(Wee::PageDecoration.new("Hello World"))
}

* add non-Rubygems way to install Wee: install.rb

--------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions lib/wee/core/component.rb
Expand Up @@ -152,6 +152,8 @@ def each_decoration # :yields: decoration
# A global decoration is added in front of the decoration chain, a local
# decoration is added in front of all other local decorations but after all
# global decorations.
#
# Returns: +self+

def add_decoration(d)
if d.global?
Expand All @@ -176,6 +178,8 @@ def add_decoration(d)
last_global.owner = d
end
end

return self
end

# Remove decoration +d+ from the decoration chain.
Expand Down

0 comments on commit dba6789

Please sign in to comment.