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.
219 220 221 |
# File 'lib/command_kit/options.rb', line 219 def option(name,**kwargs,&block) [name] = Option.new(name,**kwargs,&block) end |
#options ⇒ Hash{Symbol => Option}
All defined options for the command class.
97 98 99 100 101 102 103 |
# File 'lib/command_kit/options.rb', line 97 def @options ||= if superclass.kind_of?(ClassMethods) superclass..dup else {} end end |