Skip to content

Optional attributes - #135

Closed
skatkov wants to merge 4 commits into
mainfrom
optional-attributes
Closed

skatkov wants to merge 4 commits into
mainfrom
optional-attributes

Conversation

@skatkov

@skatkov skatkov commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Show optional positional arguments accurately in generated method headings by restoring defaults from Ruby source.

Before

Given:

def parse(source, opts = nil)

The generated heading could hide the default, making opts look required:

parse(source, opts) -> object

After

The heading preserves the source default:

parse(source, opts = nil) -> object

Default expressions are preserved without evaluating or rewriting them, including strings, hashes, regexes, interpolation, and lambdas:

split(text, separator = ",") -> Array

@skatkov skatkov closed this Nov 13, 2026
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

⌂ 换网址