Class: Solargraph::TypeChecker::ParamDef
- Inherits:
-
Object
- Object
- Solargraph::TypeChecker::ParamDef
- Defined in:
- lib/solargraph/type_checker/param_def.rb
Overview
Data about a method parameter definition. This is the information from the args list in the def call, not the `@param` tags.
Instance Attribute Summary collapse
- #name ⇒ String readonly
- #type ⇒ Symbol readonly
Class Method Summary collapse
-
.from(pin) ⇒ Array<ParamDef>
Get an array of ParamDefs from a method pin.
Instance Method Summary collapse
-
#initialize(name, type) ⇒ ParamDef
constructor
A new instance of ParamDef.
Constructor Details
#initialize(name, type) ⇒ ParamDef
13 14 15 16 |
# File 'lib/solargraph/type_checker/param_def.rb', line 13 def initialize name, type @name = name @type = type end |
Instance Attribute Details
#name ⇒ String (readonly)
8 9 10 |
# File 'lib/solargraph/type_checker/param_def.rb', line 8 def name @name end |
#type ⇒ Symbol (readonly)
11 12 13 |
# File 'lib/solargraph/type_checker/param_def.rb', line 11 def type @type end |
Class Method Details
.from(pin) ⇒ Array<ParamDef>
Get an array of ParamDefs from a method pin.
23 24 25 26 27 28 29 |
# File 'lib/solargraph/type_checker/param_def.rb', line 23 def from pin result = [] pin.parameters.each_with_index do |full, index| result.push ParamDef.new(pin.parameter_names[index], arg_type(full)) end result end |