You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -24,8 +22,7 @@ To fetch an initial copy of the gem:
24
22
bundle install
25
23
```
26
24
27
-
To update the version used by your application when updates are pushed to
28
-
GitHub:
25
+
To update the version used by your application when updates are pushed to GitHub:
29
26
30
27
```sh
31
28
bundle update orb
@@ -48,9 +45,7 @@ puts(customer.id)
48
45
49
46
### Errors
50
47
51
-
When the library is unable to connect to the API, or if the API returns a
52
-
non-success status code (i.e., 4xx or 5xx response), a subclass of
53
-
`Orb::Error` will be thrown:
48
+
When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `Orb::Error` will be thrown:
54
49
55
50
```ruby
56
51
begin
@@ -78,10 +73,9 @@ Error codes are as followed:
78
73
79
74
### Retries
80
75
81
-
Certain errors will be automatically retried 2 times by default, with a short
82
-
exponential backoff. Connection errors (for example, due to a network
Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
77
+
78
+
Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, and timeouts will all be retried by default.
85
79
86
80
You can use the `max_retries` option to configure or disable this:
87
81
@@ -102,8 +96,8 @@ orb.customers.create(
102
96
### Timeouts
103
97
104
98
By default, requests will time out after 60 seconds.
105
-
Timeouts are applied separately to the initial connection and the overall request time,
106
-
so in some cases a request could wait 2\*timeout seconds before it fails.
99
+
100
+
Timeouts are applied separately to the initial connection and the overall request time, so in some cases a request could wait 2\*timeout seconds before it fails.
107
101
108
102
You can use the `timeout` option to configure or disable this:
109
103
@@ -121,12 +115,26 @@ orb.customers.create(
121
115
)
122
116
```
123
117
118
+
## Sorbet Support
119
+
120
+
This library is written with [Sorbet type definitions](https://sorbet.org/docs/rbi). However, there is no runtime dependency on the Sorbet runtime.
121
+
122
+
What this means is that while you can use Sorbet to type check your code statically, and benefit from the [Sorbet Language Server](https://sorbet.org/docs/lsp) in your editor, there is no runtime type checking and execution overhead from Sorbet.
123
+
124
+
Due to limitations with the Sorbet type system, where a method otherwise can take an instance of `Orb::BaseModel` class, you will need to use the `**` splat operator to pass the arguments:
125
+
126
+
```ruby
127
+
model =CustomerCreateParams.new(email:"example-customer@withorb.com", name:"My Customer")
128
+
129
+
orb.customers.create(**model)
130
+
```
131
+
124
132
## Versioning
125
133
126
-
This package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the
127
-
library is in initial development and has a major version of `0`, APIs may change
128
-
at any time.
134
+
This package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the library is in initial development and has a major version of `0`, APIs may change at any time.
135
+
136
+
This package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` type definitions to be non-breaking changes.
0 commit comments