Class: Cl::Cmd
- Inherits:
-
Object
- Object
- Cl::Cmd
- Extended by:
- Dsl, Merge, Underscore
- Includes:
- Registry
- Defined in:
- lib/cl/cmd.rb,
lib/cl/dsl.rb
Overview
Direct Known Subclasses
Defined Under Namespace
Modules: Dsl
Constant Summary
Constants included from Merge
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#ctx ⇒ Object
readonly
Returns the value of attribute ctx.
-
#deprecations ⇒ Object
Returns the value of attribute deprecations.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(ctx, args) ⇒ Cmd
constructor
A new instance of Cmd.
- #opts ⇒ Object
Methods included from Merge
Methods included from Underscore
Methods included from Dsl
abstract, arg, description, examples, opt, required, required?, summary
Constructor Details
#initialize(ctx, args) ⇒ Cmd
Returns a new instance of Cmd.
44 45 46 47 48 49 |
# File 'lib/cl/cmd.rb', line 44 def initialize(ctx, args) args, opts = self.class.parse(ctx, args) @ctx = ctx @opts = self.class.opts.apply(self, self.opts.merge(opts)) @args = self.class.args.apply(self, args, opts) end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
41 42 43 |
# File 'lib/cl/cmd.rb', line 41 def args @args end |
#ctx ⇒ Object (readonly)
Returns the value of attribute ctx.
41 42 43 |
# File 'lib/cl/cmd.rb', line 41 def ctx @ctx end |
#deprecations ⇒ Object
Returns the value of attribute deprecations.
42 43 44 |
# File 'lib/cl/cmd.rb', line 42 def deprecations @deprecations end |
Class Method Details
.cmds ⇒ Object
28 29 30 |
# File 'lib/cl/cmd.rb', line 28 def cmds registry.values end |
Instance Method Details
#opts ⇒ Object
51 52 53 |
# File 'lib/cl/cmd.rb', line 51 def opts @opts ||= {} end |