Class: Rucoa::Definitions::ClassDefinition

Inherits:
ModuleDefinition show all
Defined in:
lib/rucoa/definitions/class_definition.rb

Instance Attribute Summary collapse

Attributes inherited from ModuleDefinition

#extended_module_qualified_names, #extended_module_unqualified_names, #included_module_qualified_names, #included_module_unqualified_names, #prepended_module_qualified_names, #prepended_module_unqualified_names

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(super_class_qualified_name: nil, super_class_unqualified_name: nil, **keyword_arguments) ⇒ ClassDefinition

Returns a new instance of ClassDefinition.

Parameters:

  • super_class_qualified_name (String, nil) (defaults to: nil)
  • super_class_unqualified_name (Rucoa::UnqualifiedName, nil) (defaults to: nil)


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

def initialize(
  super_class_qualified_name: nil,
  super_class_unqualified_name: nil,
  **keyword_arguments
)
  super(**keyword_arguments)
  @super_class_qualified_name = super_class_qualified_name
  @super_class_unqualified_name = super_class_unqualified_name
end

Instance Attribute Details

#super_class_qualified_nameString?

Returns:

  • (String, nil)


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

def super_class_qualified_name
  @super_class_qualified_name
end

#super_class_unqualified_nameRucoa::UnqualifiedName?

Returns:



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

def super_class_unqualified_name
  @super_class_unqualified_name
end

Instance Method Details

#merge!(other) ⇒ Object



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

def merge!(other)
  self.super_class_qualified_name ||= other.super_class_qualified_name
  self.super_class_unqualified_name ||= other.super_class_unqualified_name
  super
end