Skip to content

Add method to_d (convert into BigDecimal) to some classes - #936

Merged
soutaro merged 1 commit into
ruby:masterfrom
takahashim:bigdecimal-to_d
Mar 31, 2022
Merged

soutaro merged 1 commit into
ruby:masterfrom
takahashim:bigdecimal-to_d

Conversation

@takahashim

Copy link
Copy Markdown
Contributor

Target classes: Integer, Float, String, BigDecimal, Rational, Complex and NilClass

Integer, Float, String, BigDecimal, Rational, Complex and NilClass

@ksss ksss left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One way to do it is to create bigdecimal-util like bigdecimal-math, but RBS seems to be a tool that takes convenience over correctness, so this seems to be the way to go.


# call-seq:
# a.to_d -> bigdecimal
#

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe call-seq is not necessary.
I think you should use the rbs annotate tool.

soutaro
soutaro previously approved these changes Mar 28, 2022

@soutaro soutaro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you try copying RDoc using rbs annotate?

@soutaro
soutaro dismissed their stale review March 28, 2022 13:27

🙇‍♂️

@soutaro soutaro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you try copying RDoc using rbs annotate?

@soutaro soutaro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging this PR. Will update the docs myself.

@soutaro
soutaro merged commit 6b54291 into ruby:master Mar 31, 2022
@soutaro soutaro mentioned this pull request Mar 31, 2022
ksss added a commit to ksss/gem_rbs_collection that referenced this pull request Feb 2, 2025
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.

3 participants