Skip to content

[Ruby][from_hash] Handle nilable Symbol conversion#205

Merged
juharris merged 1 commit intomainfrom
jus/ruby-symbol-from-hash
Apr 9, 2026
Merged

[Ruby][from_hash] Handle nilable Symbol conversion#205
juharris merged 1 commit intomainfrom
jus/ruby-symbol-from-hash

Conversation

@juharris
Copy link
Copy Markdown
Owner

@juharris juharris commented Apr 9, 2026

Summary

  • Fix T.nilable(Symbol) properties not being converted from String to Symbol during from_hash
  • Extract _unwrap_nilable helper to deduplicate nilable type unwrapping across Symbol and Array handling in _convert_value
  • Add test_symbol and test_nilable_symbol tests for Symbol and T.nilable(Symbol) property types

Details

The _convert_value method checked for Symbol type before unwrapping T.nilable(...), so T.nilable(Symbol) properties were silently left as Strings. Now nilable is unwrapped once at the top of the method and reused for both the Symbol check and the Array inner type extraction, removing a duplicate unwrap_nilable call.

🤖 Generated with the help of Claude Code. This pull request description and possibly the code was generated by AI, but the user has most likely reviewed all of the code changes.

Extract _unwrap_nilable helper to deduplicate nilable type unwrapping
across Symbol and Array handling in _convert_value.

🤖 Generated with the help of Claude Code. This commit message was generated by AI, but the user has most likely reviewed all of the code changes.

Co-Authored-By: Claude <noreply@anthropic.com>
@juharris juharris changed the title [Ruby][from_hash] Fix nilable Symbol conversion and add tests [Ruby][from_hash] Handle nilable Symbol conversion Apr 9, 2026
@juharris juharris marked this pull request as ready for review April 9, 2026 21:44
@juharris juharris merged commit 3bc3721 into main Apr 9, 2026
16 checks passed
@juharris juharris deleted the jus/ruby-symbol-from-hash branch April 9, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant