Class: Ccp::Invokers::Base
- Inherits:
-
Object
- Object
- Ccp::Invokers::Base
- Includes:
- Commands::Composite, Utils::Options
- Defined in:
- lib/ccp/invokers/base.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #after ⇒ Object
-
#initialize(options = {}) ⇒ Base
constructor
Instance Methods.
Methods included from Utils::Options
Methods included from Commands::Composite
#commands, #execute, included, #receiver=
Methods included from Commands::Core
Constructor Details
#initialize(options = {}) ⇒ Base
Instance Methods
37 38 39 40 41 42 43 |
# File 'lib/ccp/invokers/base.rb', line 37 def initialize( = {}) self.receiver = .delete(:receiver) || self.class.receiver.new receiver.parse!(self.class.) receiver.parse!() receiver.data.default.merge!(self.class.builtins.) receiver.data.default.merge!(self.class.) end |
Class Method Details
.execute(options = {}, &block) ⇒ Object
Class Methods
21 22 23 24 25 26 |
# File 'lib/ccp/invokers/base.rb', line 21 def self.execute( = {}, &block) cmd = new() cmd.instance_eval(&block) if block_given? cmd.receiver.execute(cmd) return cmd end |
.receiver_options ⇒ Object
28 29 30 31 32 |
# File 'lib/ccp/invokers/base.rb', line 28 def self. opts = fixtures. opts[:fixture_keys] ||= builtins..keys.map{|i| "!#{i}"} return opts end |
Instance Method Details
#after ⇒ Object
45 46 47 48 |
# File 'lib/ccp/invokers/base.rb', line 45 def after receiver.show_profiles if data?(:profile) receiver.show_comments if data?(:comment) end |