Class: OllamaAgent::Topology::IR::ClassNode

Inherits:
Data
  • Object
show all
Defined in:
lib/ollama_agent/topology/ir/class_node.rb

Overview

Ruby class definition (include / extend FQCN strings; methods are signature hashes). rubocop:disable Lint/DataDefineOverride – IR field name methods is part of the public contract.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#extendsObject (readonly)

Returns the value of attribute extends

Returns:

  • (Object)

    the current value of extends



8
9
10
# File 'lib/ollama_agent/topology/ir/class_node.rb', line 8

def extends
  @extends
end

#fqcnObject (readonly)

Returns the value of attribute fqcn

Returns:

  • (Object)

    the current value of fqcn



8
9
10
# File 'lib/ollama_agent/topology/ir/class_node.rb', line 8

def fqcn
  @fqcn
end

#includesObject (readonly)

Returns the value of attribute includes

Returns:

  • (Object)

    the current value of includes



8
9
10
# File 'lib/ollama_agent/topology/ir/class_node.rb', line 8

def includes
  @includes
end

#kindObject (readonly)

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



8
9
10
# File 'lib/ollama_agent/topology/ir/class_node.rb', line 8

def kind
  @kind
end

#methodsObject (readonly)

Returns the value of attribute methods

Returns:

  • (Object)

    the current value of methods



8
9
10
# File 'lib/ollama_agent/topology/ir/class_node.rb', line 8

def methods
  @methods
end

#module_chainObject (readonly)

Returns the value of attribute module_chain

Returns:

  • (Object)

    the current value of module_chain



8
9
10
# File 'lib/ollama_agent/topology/ir/class_node.rb', line 8

def module_chain
  @module_chain
end

#origin_extractor_versionObject (readonly)

Returns the value of attribute origin_extractor_version

Returns:

  • (Object)

    the current value of origin_extractor_version



8
9
10
# File 'lib/ollama_agent/topology/ir/class_node.rb', line 8

def origin_extractor_version
  @origin_extractor_version
end

#source_lineObject (readonly)

Returns the value of attribute source_line

Returns:

  • (Object)

    the current value of source_line



8
9
10
# File 'lib/ollama_agent/topology/ir/class_node.rb', line 8

def source_line
  @source_line
end

#source_pathObject (readonly)

Returns the value of attribute source_path

Returns:

  • (Object)

    the current value of source_path



8
9
10
# File 'lib/ollama_agent/topology/ir/class_node.rb', line 8

def source_path
  @source_path
end

#superclass_fqcnObject (readonly)

Returns the value of attribute superclass_fqcn

Returns:

  • (Object)

    the current value of superclass_fqcn



8
9
10
# File 'lib/ollama_agent/topology/ir/class_node.rb', line 8

def superclass_fqcn
  @superclass_fqcn
end

Class Method Details

.build(source_path:, source_line:, origin_extractor_version:, fqcn:, superclass_fqcn: nil, module_chain: [], methods: [], includes: [], extends: []) ⇒ Object

rubocop:disable Metrics/ParameterLists – factory mirrors Data members explicitly.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/ollama_agent/topology/ir/class_node.rb', line 21

def self.build(
  source_path:,
  source_line:,
  origin_extractor_version:,
  fqcn:,
  superclass_fqcn: nil,
  module_chain: [],
  methods: [],
  includes: [],
  extends: []
)
  # rubocop:enable Metrics/ParameterLists
  new(:class, source_path.to_s, Integer(source_line), origin_extractor_version.to_s, fqcn.to_s,
      superclass_fqcn&.to_s, Array(module_chain).map(&:to_s).freeze, IR.deep_freeze_hashes(methods),
      Array(includes).map(&:to_s).freeze, Array(extends).map(&:to_s).freeze)
end