-
Notifications
You must be signed in to change notification settings - Fork 552
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add method parameter type classes to all resources and services (#1505)
* barebones request params * fixes * manual changes * Generated changes * Add search params * manual change - update to cast params * add more test * add newliens (generated)
- Loading branch information
1 parent
beda56c
commit bc1d5a8
Showing
723 changed files
with
352,358 additions
and
4,897 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# frozen_string_literal: true | ||
# typed: true | ||
|
||
module Stripe | ||
# For internal use only. Does not provide a stable API and may be broken | ||
# with future non-major changes. | ||
class RequestParams | ||
def to_h | ||
instance_variables.each_with_object({}) do |var, hash| | ||
key = var.to_s.delete("@").to_sym | ||
value = instance_variable_get(var) | ||
|
||
hash[key] = if value.is_a?(RequestParams) | ||
value.to_h | ||
# Check if value is an array and contains RequestParams objects | ||
elsif value.is_a?(Array) | ||
value.map { |item| item.is_a?(RequestParams) ? item.to_h : item } | ||
else | ||
value | ||
end | ||
end | ||
end | ||
end | ||
end |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.