Class: Ccp::Invokers::Base
- Inherits:
-
Object
- Object
- Ccp::Invokers::Base
- Includes:
- Commands::Composite
- Defined in:
- lib/ccp/invokers/base.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ :profile => false, :comment => true, }
Instance Method Summary collapse
- #benchmark ⇒ Object
- #execute ⇒ Object
-
#initialize(options = nil) ⇒ Base
constructor
Instance Methods.
- #receiver ⇒ Object
- #receiver=(value) ⇒ Object
- #set_default_options ⇒ Object
Methods included from Commands::Composite
Methods included from Commands::Core
Methods included from Commands::Commentable
Constructor Details
#initialize(options = nil) ⇒ Base
Instance Methods
20 21 22 23 24 |
# File 'lib/ccp/invokers/base.rb', line 20 def initialize( = nil) self.receiver = self.class.receiver.new self.class.prepend_command Commands::RuntimeArgs, end |
Instance Method Details
#benchmark ⇒ Object
37 38 39 40 41 42 |
# File 'lib/ccp/invokers/base.rb', line 37 def benchmark before super after return true end |
#execute ⇒ Object
33 34 35 |
# File 'lib/ccp/invokers/base.rb', line 33 def execute benchmark end |
#receiver ⇒ Object
44 45 46 |
# File 'lib/ccp/invokers/base.rb', line 44 def receiver @receiver.must(Receivers::Base) end |
#receiver=(value) ⇒ Object
48 49 50 |
# File 'lib/ccp/invokers/base.rb', line 48 def receiver=(value) @receiver = value.must(Receivers::Base) end |
#set_default_options ⇒ Object
26 27 28 29 30 31 |
# File 'lib/ccp/invokers/base.rb', line 26 def self.class::DEFAULT_OPTIONS.each_pair do |key,val| data.default[key] = val end data.default(:logger) { Logger.new($stderr) } end |