Class: Rucoa::Definitions::MethodParameterDefinition

Inherits:
Base
  • Object
show all
Defined in:
lib/rucoa/definitions/method_parameter_definition.rb

Overview

Represents method parameter definition.

Instance Attribute Summary collapse

Attributes inherited from Base

#description, #location

Instance Method Summary collapse

Constructor Details

#initialize(name:, types:) ⇒ MethodParameterDefinition

Returns a new instance of MethodParameterDefinition.

Parameters:

  • name (String)
  • types (Array<String>)


15
16
17
18
19
20
21
22
# File 'lib/rucoa/definitions/method_parameter_definition.rb', line 15

def initialize(
  name:,
  types:
)
  super()
  @name = name
  @types = types
end

Instance Attribute Details

#nameString (readonly)

Returns:

  • (String)


8
9
10
# File 'lib/rucoa/definitions/method_parameter_definition.rb', line 8

def name
  @name
end

#typesArray<String> (readonly)

Returns:

  • (Array<String>)


11
12
13
# File 'lib/rucoa/definitions/method_parameter_definition.rb', line 11

def types
  @types
end

Instance Method Details

#to_hashHash{Symbol => Object}

Returns:

  • (Hash{Symbol => Object})


25
26
27
28
29
30
# File 'lib/rucoa/definitions/method_parameter_definition.rb', line 25

def to_hash
  {
    name: name,
    types: types
  }
end