Skip to content

Refactor: Rename registerCallMethod* to registerOnSend* for consistent naming #402

@takaokouji

Description

@takaokouji

Problem

The Ruby-to-blocks converter currently uses inconsistent naming for method call registration:

  • registerCallMethod
  • registerCallMethodWithBlock
  • registerCallMyBlock

This naming is inconsistent with the newer registerOnXxx pattern introduced in #399/#400 and doesn't clearly convey that these methods handle onSend events (method calls).

Solution

Rename all registerCallMethod* functions to use consistent registerOnSend* naming:

Proposed Renamings

  • registerCallMethodregisterOnSend
  • registerCallMethodWithBlockregisterOnSendWithBlock
  • registerCallMyBlockregisterOnSendMyBlock

Scope

This affects all converter files that use these registration methods:

  • Motion converter
  • Looks converter
  • Sound converter
  • Event converter
  • Control converter
  • Sensing converter
  • Operators converter
  • Variables converter
  • MyBlocks converter
  • Core infrastructure in index.js

Benefits

  1. Consistency: Aligns with the registerOnXxx pattern established in refactor: migrate remaining onXxx handlers to register pattern #399/feat: implement registerOnXxx infrastructure for Ruby-to-blocks converter #400
  2. Clarity: Makes it clear these methods handle onSend events (method calls)
  3. Maintainability: Consistent naming improves code readability
  4. Semantic Accuracy: Better reflects the actual functionality

Implementation Plan

  1. Create feature branch refactor/register-on-send-naming
  2. Refactor each converter category individually with separate commits
  3. Update core infrastructure in index.js
  4. Ensure all tests pass
  5. Update documentation if needed

Acceptance Criteria

  • All registerCallMethod* functions renamed to registerOnSend*
  • All converter files updated to use new method names
  • Core infrastructure updated in index.js
  • All tests pass
  • No functional changes - purely a refactoring
  • Consistent naming pattern across the codebase

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions