Module: Ronin::Core::Params::Mixin::ClassMethods
- Defined in:
- lib/ronin/core/params/mixin.rb
Overview
Class methods.
Instance Method Summary collapse
-
#param(name, type = Types::String.new, required: false, default: nil, desc:, **kwargs) ⇒ Object
Defines a new param.
-
#params ⇒ Hash{Symbol => Param}
private
All defined params.
Instance Method Details
#param(name, type = Types::String.new, required: false, default: nil, desc:, **kwargs) ⇒ Object
Defines a new param.
184 185 186 187 188 189 190 191 192 193 194 195 196 |
# File 'lib/ronin/core/params/mixin.rb', line 184 def param(name,type=Types::String.new, required: false, default: nil, desc: , **kwargs) type = case type when Types::Type then type else Types.lookup(type).new(**kwargs) end params[name] = Param.new(name,type, required: required, default: default, desc: desc) end |
#params ⇒ Hash{Symbol => Param}
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
All defined params.
105 106 107 108 109 110 111 |
# File 'lib/ronin/core/params/mixin.rb', line 105 def params @params ||= if superclass < Mixin superclass.params.dup else {} end end |