Class: Rucoa::Definitions::ModuleDefinition

Inherits:
ConstantDefinition show all
Defined in:
lib/rucoa/definitions/module_definition.rb

Direct Known Subclasses

ClassDefinition

Instance Attribute Summary collapse

Attributes inherited from ConstantDefinition

#qualified_name

Attributes inherited from Base

#description, #location

Instance Method Summary collapse

Methods inherited from ConstantDefinition

#name, #namespace

Constructor Details

#initialize(extended_module_qualified_names: [], extended_module_unqualified_names: [], included_module_qualified_names: [], included_module_unqualified_names: [], prepended_module_qualified_names: [], prepended_module_unqualified_names: [], **keyword_arguments) ⇒ ModuleDefinition

Returns a new instance of ModuleDefinition.

Parameters:

  • extended_module_qualified_names (Array<String>) (defaults to: [])
  • extended_module_unqualified_names (Array<String>) (defaults to: [])
  • included_module_qualified_names (Array<String>) (defaults to: [])
  • included_module_unqualified_names (Array<String>) (defaults to: [])
  • prepended_module_qualified_names (Array<String>) (defaults to: [])
  • prepended_module_unqualified_names (Array<String>) (defaults to: [])


30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/rucoa/definitions/module_definition.rb', line 30

def initialize(
  extended_module_qualified_names: [],
  extended_module_unqualified_names: [],
  included_module_qualified_names: [],
  included_module_unqualified_names: [],
  prepended_module_qualified_names: [],
  prepended_module_unqualified_names: [],
  **keyword_arguments
)
  super(**keyword_arguments)
  @extended_module_qualified_names = extended_module_qualified_names
  @extended_module_unqualified_names = extended_module_unqualified_names
  @included_module_qualified_names = included_module_qualified_names
  @included_module_unqualified_names = included_module_unqualified_names
  @prepended_module_qualified_names = prepended_module_qualified_names
  @prepended_module_unqualified_names = prepended_module_unqualified_names
end

Instance Attribute Details

#extended_module_qualified_namesArray<String>

Returns:

  • (Array<String>)


7
8
9
# File 'lib/rucoa/definitions/module_definition.rb', line 7

def extended_module_qualified_names
  @extended_module_qualified_names
end

#extended_module_unqualified_namesArray<Rucoa::UnqualifiedName>

Returns:



10
11
12
# File 'lib/rucoa/definitions/module_definition.rb', line 10

def extended_module_unqualified_names
  @extended_module_unqualified_names
end

#included_module_qualified_namesArray<String>

Returns:

  • (Array<String>)


13
14
15
# File 'lib/rucoa/definitions/module_definition.rb', line 13

def included_module_qualified_names
  @included_module_qualified_names
end

#included_module_unqualified_namesArray<Rucoa::UnqualifiedName>

Returns:



16
17
18
# File 'lib/rucoa/definitions/module_definition.rb', line 16

def included_module_unqualified_names
  @included_module_unqualified_names
end

#prepended_module_qualified_namesArray<String>

Returns:

  • (Array<String>)


19
20
21
# File 'lib/rucoa/definitions/module_definition.rb', line 19

def prepended_module_qualified_names
  @prepended_module_qualified_names
end

#prepended_module_unqualified_namesArray<Rucoa::UnqualifiedName>

Returns:



22
23
24
# File 'lib/rucoa/definitions/module_definition.rb', line 22

def prepended_module_unqualified_names
  @prepended_module_unqualified_names
end

Instance Method Details

#merge!(other) ⇒ Rucoa::Definitions::ModuleDefinition



50
51
52
53
54
55
56
57
58
# File 'lib/rucoa/definitions/module_definition.rb', line 50

def merge!(other)
  self.extended_module_qualified_names |= other.extended_module_qualified_names
  self.extended_module_unqualified_names |= other.extended_module_unqualified_names
  self.included_module_qualified_names |= other.included_module_qualified_names
  self.included_module_unqualified_names |= other.included_module_unqualified_names
  self.prepended_module_qualified_names |= other.prepended_module_qualified_names
  self.prepended_module_unqualified_names |= other.prepended_module_unqualified_names
  self
end