134 |
def manager=(manager) |
def manager=(manager) |
135 |
raise "Slot #{@path} already has an active manager: #{@manager}" if @manager |
raise "Slot #{@path} already has an active manager: #{@manager}" if @manager |
136 |
@manager = manager |
@manager = manager |
137 |
|
notify(:notify_slot_managed) |
138 |
end |
end |
139 |
|
|
140 |
## |
## |
210 |
## |
## |
211 |
# Iterates over the sub-slots and link slots |
# Iterates over the sub-slots and link slots |
212 |
# |
# |
213 |
|
# recurse:: [Boolean=false] if true, recurses all child slots |
214 |
# yeild:: [FreeBASE::DataBus::Slot] The child slot |
# yeild:: [FreeBASE::DataBus::Slot] The child slot |
215 |
# |
# |
216 |
def each_slot |
def each_slot(recurse=false, &block) |
217 |
@slots.each_value {|slot| yield slot} |
raise "Must supply a block as an iterator" unless block_given? |
218 |
@links.each_value {|slot| yield slot} |
@slots.each_value do |slot| |
219 |
|
yield slot |
220 |
|
slot.each_slot(recurse, &block) if recurse |
221 |
|
end |
222 |
|
@links.each_value do |slot| |
223 |
|
yield slot |
224 |
|
slot.each_slot(recurse, &block) if recurse |
225 |
|
end |
226 |
end |
end |
227 |
|
|
228 |
## |
## |
376 |
end |
end |
377 |
|
|
378 |
## |
## |
379 |
# calls proc.call if this is a proc slot |
# calls proc.call if this is a proc slot (invoke is an alias) |
380 |
# |
# |
381 |
def call(*args) |
def call(*args) |
382 |
self.proc.call(*args) |
self.proc.call(*args) |