Module: Ccp::Commands::Composite

Includes:
Core, Enumerable
Included in:
Invokers::Base
Defined in:
lib/ccp/commands/composite.rb

Defined Under Namespace

Modules: ClassMethods Classes: CommandClass

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Core

#inspect

Methods included from Commentable

#MEMO, #TODO

Methods included from Executable

#benchmark

Methods included from Receivable

#receiver

Class Method Details

.included(base) ⇒ Object



4
5
6
7
8
# File 'lib/ccp/commands/composite.rb', line 4

def self.included(base)
  base.class_eval do
    extend ClassMethods
  end
end

Instance Method Details

#commandsObject

Enumerable



59
60
61
# File 'lib/ccp/commands/composite.rb', line 59

def commands
  @commands ||= build_commands.must(Array)
end

#executeObject

Commands



66
67
68
# File 'lib/ccp/commands/composite.rb', line 66

def execute
  commands.each(&:benchmark)
end

#receiver=(value) ⇒ Object



70
71
72
73
# File 'lib/ccp/commands/composite.rb', line 70

def receiver=(value)
  super
  commands.each{|c| c.receiver = value}
end