Path: blob/master/lib/rex/post/channel/container.rb
19850 views
# -*- coding: binary -*-12module Rex3module Post4module Channel5###6#7# This interface is meant to be included by things that are meant to contain8# zero or more channel instances in the form of a hash.9#10###11module Container12#13# Initializes the channel association hash14#15def initialize_channels16self.channels = {}17end1819#20# Adds a channel to the container that is indexed by its channel identifier21#22def add_channel(channel)23channels[channel.cid] = channel24end2526#27# Looks up a channel instance based on its channel identifier28#29def find_channel(cid)30return channels[cid]31end3233#34# Removes a channel based on its channel identifier35#36def remove_channel(cid)37return channels.delete(cid)38end3940#41# The hash of channels.42#43attr_reader :channels4445protected4647attr_writer :channels # :nodoc:48end49end50end51end525354