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.
143 144 145 |
# File 'lib/command_kit/arguments.rb', line 143 def argument(name,**kwargs) arguments[name] = Argument.new(name,**kwargs) end |
#arguments ⇒ Hash{Symbol => Argument}
All defined arguments for the class.
87 88 89 90 91 92 93 |
# File 'lib/command_kit/arguments.rb', line 87 def arguments @arguments ||= if superclass.kind_of?(ClassMethods) superclass.arguments.dup else {} end end |