diff options
author | Luke Kanies <luke@madstop.com> | 2005-05-16 16:50:22 +0000 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2005-05-16 16:50:22 +0000 |
commit | 135134cca7f16fbd14f2d7572c2b0a2e0432e1b1 (patch) | |
tree | 45bb637e69332a71e0ad540ea8ad33569630707a /lib | |
parent | 4da3b51af5fc52caf5dcc1b9a98cb1a232252230 (diff) | |
download | puppet-135134cca7f16fbd14f2d7572c2b0a2e0432e1b1.tar.gz puppet-135134cca7f16fbd14f2d7572c2b0a2e0432e1b1.tar.xz puppet-135134cca7f16fbd14f2d7572c2b0a2e0432e1b1.zip |
updates
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@249 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r-- | lib/blink/type/container.rb | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/lib/blink/type/container.rb b/lib/blink/type/container.rb index 99ffdc836..7d289e45f 100644 --- a/lib/blink/type/container.rb +++ b/lib/blink/type/container.rb @@ -5,17 +5,35 @@ # the object allowing us to build complex structures # this thing contains everything else, including itself +require 'blink' +require 'blink/element' +require 'blink/transaction' require 'blink/type' module Blink - class Component < Blink::Type - @name = :component - @namevar = :name + class Container < Blink::Element + @name = :container - @parameters = [ - :name - ] + def initialize + @children = [] + end - @states = [] + # now we decide whether a transaction is dumb, and just accepts + # changes from the container, or whether it collects them itself + # for now, because i've already got this implemented, let transactions + # collect the changes themselves + def evaluate + return transaction = Blink::Transaction.new(@children) + #transaction.run + end + + def push(*ary) + ary.each { |child| + unless child.is_a?(Blink::Element) + raise "Containers can only contain Blink::Elements" + end + @children.push child + } + end end end |