Skip to content

Add Support for Ruby Mixins (Modules) #358

@Shashankss1205

Description

@Shashankss1205
  • Description: Ruby uses modules to group methods. When a class includes a module, it gains the module's methods.
  • Graphing Strategy: Model as an INCLUDES relationship from a :Class node to a :Module node.

Implementation Steps

This requires a :Module node type and an INCLUDES relationship.

  1. Modify the Ruby Parser (.../languages/ruby.py)

    • Add queries to find both module definitions and include statements within classes.
    • Create _find_modules and _find_module_inclusions methods.
    • Return the results under keys "modules" and "module_inclusions".
  2. Update the Generic Graph Builder (.../tools/graph_builder.py)

    • Add a :Module node type following the standard procedure (add constraint to create_schema, add to item_mappings).
    • Add a new section in add_file_to_graph to process module_inclusions and create the INCLUDES relationships.

Metadata

Metadata

Assignees

Labels

Hacktoberfest25This issue is created as a part of Hacktoberfest 2025 programgood first issueGood for newcomers

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions