Module: CommandKit::Arguments::ClassMethods
- Defined in:
- lib/command_kit/arguments.rb
Overview
Defines class-level methods.
Instance Method Summary collapse
-
#argument(name, **kwargs) ⇒ Argument
Defines an argument for the class.
-
#arguments ⇒ Hash{Symbol => Argument}
All defined arguments for the class.
Instance Method Details
#argument(name, **kwargs) ⇒ Argument
Defines an argument for the class.
147 148 149 |
# File 'lib/command_kit/arguments.rb', line 147 def argument(name,**kwargs) arguments[name] = Argument.new(name,**kwargs) end |
#arguments ⇒ Hash{Symbol => Argument}
All defined arguments for the class.
91 92 93 94 95 96 97 |
# File 'lib/command_kit/arguments.rb', line 91 def arguments @arguments ||= if superclass.kind_of?(ClassMethods) superclass.arguments.dup else {} end end |