Class: Inch::Language::Elixir::Provider::Reader::Object::FunctionParameterObject

Inherits:
Object
  • Object
show all
Defined in:
lib/inch/language/elixir/provider/reader/object/function_parameter_object.rb

Overview

Proxy class for function parameters

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method, name) ⇒ FunctionParameterObject

Returns a new instance of FunctionParameterObject.

Parameters:

  • method (YARD::Object::MethodObject)

    the method the parameter belongs to

  • name (String)

    the name of the parameter



14
15
16
17
# File 'lib/inch/language/elixir/provider/reader/object/function_parameter_object.rb', line 14

def initialize(method, name)
  @method = method
  @name = name
end

Instance Attribute Details

#nameString (readonly)

Returns:

  • (String)


9
10
11
# File 'lib/inch/language/elixir/provider/reader/object/function_parameter_object.rb', line 9

def name
  @name
end

Instance Method Details

#block?Boolean

Returns true if the parameter is a block.

Returns:

  • (Boolean)

    true if the parameter is a block



20
21
22
# File 'lib/inch/language/elixir/provider/reader/object/function_parameter_object.rb', line 20

def block?
  false
end

#described?Boolean

Returns true if an additional description is given?.

Returns:

  • (Boolean)

    true if an additional description is given?



25
26
27
# File 'lib/inch/language/elixir/provider/reader/object/function_parameter_object.rb', line 25

def described?
  described_by_docstring?
end

#mentioned?Boolean

Returns true if the parameter is mentioned in the docs.

Returns:

  • (Boolean)

    true if the parameter is mentioned in the docs



31
32
33
# File 'lib/inch/language/elixir/provider/reader/object/function_parameter_object.rb', line 31

def mentioned?
  mentioned_by_docstring?
end

#splat?Boolean

Returns true if the parameter is a splat argument.

Returns:

  • (Boolean)

    true if the parameter is a splat argument



36
37
38
# File 'lib/inch/language/elixir/provider/reader/object/function_parameter_object.rb', line 36

def splat?
  false
end

#typed?Boolean

Returns true if the type of the parameter is defined.

Returns:

  • (Boolean)

    true if the type of the parameter is defined



41
42
43
# File 'lib/inch/language/elixir/provider/reader/object/function_parameter_object.rb', line 41

def typed?
  false # TODO: parse types of params
end

#wrongly_mentioned?Boolean

Returns true if the parameter is mentioned in the docs, but not present in the method’s signature.

Returns:

  • (Boolean)

    true if the parameter is mentioned in the docs, but not present in the method’s signature



47
48
49
# File 'lib/inch/language/elixir/provider/reader/object/function_parameter_object.rb', line 47

def wrongly_mentioned?
  false
end