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