Module: Caliph::DefineOp::ClassMethods
- Defined in:
- lib/caliph/define-op.rb
Instance Method Summary collapse
Instance Method Details
#define_chain_op(opname, klass) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/caliph/define-op.rb', line 8 def define_chain_op(opname, klass) define_method(opname) do |other| unless CommandLine === other other = CommandLine.new(*[*other]) end chain = nil if klass === self chain = self else chain = klass.new chain.definition_watcher = definition_watcher unless definition_watcher.nil? definition_watcher.apex = chain end chain.add(self) end chain.add(other) end end |
#define_op(opname) ⇒ Object
28 29 30 |
# File 'lib/caliph/define-op.rb', line 28 def define_op(opname) CommandLine.define_chain_op(opname, self) end |