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.
161 162 163 |
# File 'lib/command_kit/arguments.rb', line 161 def argument(name,**kwargs) arguments[name] = Argument.new(name,**kwargs) end |
#arguments ⇒ Hash{Symbol => Argument}
All defined arguments for the class.
99 100 101 102 103 104 105 |
# File 'lib/command_kit/arguments.rb', line 99 def arguments @arguments ||= if superclass.kind_of?(ClassMethods) superclass.arguments.dup else {} end end |