Module: CommandKit::Options::ClassMethods
- Defined in:
- lib/command_kit/options.rb
Overview
Defines class-level methods.
Instance Method Summary collapse
-
#option(name, **kwargs) {|(value)| ... } ⇒ Option
Defines an option for the class.
-
#options ⇒ Hash{Symbol => Option}
All defined options for the command class.
Instance Method Details
#option(name, **kwargs) {|(value)| ... } ⇒ Option
Defines an option for the class.
182 183 184 |
# File 'lib/command_kit/options.rb', line 182 def option(name,**kwargs,&block) [name] = Option.new(name,**kwargs,&block) end |
#options ⇒ Hash{Symbol => Option}
All defined options for the command class.
76 77 78 79 80 81 82 |
# File 'lib/command_kit/options.rb', line 76 def ||= if superclass.kind_of?(ClassMethods) superclass..dup else {} end end |