Module: Ccp::Commands::Composite
Defined Under Namespace
Modules: ClassMethods Classes: CommandClass
Class Method Summary collapse
Instance Method Summary collapse
-
#commands ⇒ Object
Enumerable.
-
#execute ⇒ Object
Commands.
- #receiver=(value) ⇒ Object
Methods included from Core
Methods included from Commentable
Methods included from Receivable
Class Method Details
.included(base) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/ccp/commands/composite.rb', line 4 def self.included(base) super base.class_eval do extend ClassMethods extend Executable::ClassMethods include Fixturable end end |
Instance Method Details
#commands ⇒ Object
Enumerable
62 63 64 |
# File 'lib/ccp/commands/composite.rb', line 62 def commands @commands ||= build_commands.must(Array) end |
#execute ⇒ Object
Commands
69 70 71 72 73 |
# File 'lib/ccp/commands/composite.rb', line 69 def execute commands.each do |c| c.receiver.execute(c) end end |
#receiver=(value) ⇒ Object
75 76 77 78 |
# File 'lib/ccp/commands/composite.rb', line 75 def receiver=(value) super commands.each{|c| c.receiver = value} end |