-
Notifications
You must be signed in to change notification settings - Fork 547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add explicit attributes for fields in resources, and rbis for resources #1490
base: beta
Are you sure you want to change the base?
Conversation
ce30eab
to
b1df5e1
Compare
b1df5e1
to
853ccc6
Compare
8d598c8
to
8fb9b42
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor formatting things, but no big concerns. looks awesome!
sig { returns(T.nilable(Integer)) } | ||
attr_reader :void_at | ||
end | ||
sig { returns(Integer) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that anyone is really reading these, but they'd be a little more legible with the comment first, then sign, then attr
, then a line break:
# Change to a FinancialAccount's balance
sig { returns(BalanceImpact) }
attr_reader :balance_impact
# Change to a FinancialAccount's balance
sig { returns(BalanceImpact) }
attr_reader :balance_impact
Assuming that ordering plays nicely with hovering in VScode. Either way, a line break might be nice (but that can be in a later PR, not important to regenerate this for that)
# The last four digits of the token. | ||
attr_reader :last4 | ||
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. | ||
attr_reader :livemode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line breaks would be nice in here as well, IMO
Why?
This is the first step in #1479 - this adds explicit attributes for fields in resources, and adds RBIs with type annotations for them. This is not yet ready for use as it does not define any methods, so I have not included the RBIs in the gemspec.
What?
I recommend reviewing this mostly through the codegen PR, as this is almost entirely generated changes.
Important notes:
lib/stripe/resources/amount.rb
andrbi/stripe/resources/amount.rbi
because it is a type used in V2.StripeObject.add_accessors
(lib/stripe/stripe_object.rb
) to appropriately set instance variables upon creation..rubocop.yml
to ignore variable numbers, since we have field names in various conventions in the API.