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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ This will install all the required dependencies.
14
14
15
15
## Modifying/Adding code
16
16
17
-
Most of the SDK is generated code. Modifications to code will be persisted between generations, but may result in merge conflicts between manual patches and changes from the generator. The generator will never modify the contents of `lib/tilda/helpers/` and `examples/` directory.
17
+
Most of the SDK is generated code. Modifications to code will be persisted between generations, but may result in merge conflicts between manual patches and changes from the generator. The generator will never modify the contents of `lib/tilda_ruby/helpers/` and `examples/` directory.
18
18
19
19
## Adding and running examples
20
20
@@ -24,7 +24,7 @@ All files in the `examples/` directory are not modified by the generator and can
24
24
#!/usr/bin/env ruby
25
25
# frozen_string_literal: true
26
26
27
-
require_relative"../lib/tilda"
27
+
require_relative"../lib/tilda_ruby"
28
28
29
29
# ...
30
30
```
@@ -43,17 +43,17 @@ If you’d like to use the repository from source, you can either install from g
Copy file name to clipboardExpand all lines: README.md
+21-17Lines changed: 21 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,32 @@
1
1
# Tilda Ruby API library
2
2
3
-
The Tilda Ruby library provides convenient access to the Tilda REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/stainless-sdks/tilda-ruby#Sorbet) for usage with Sorbet. The standard library's `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem.
3
+
The Tilda Ruby library provides convenient access to the Tilda REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/Hexlet/tilda-ruby#Sorbet) for usage with Sorbet. The standard library's `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem.
4
4
5
5
It is generated with [Stainless](https://www.stainless.com/).
6
6
7
7
## Documentation
8
8
9
-
Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/tilda).
9
+
Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/tilda-ruby).
10
10
11
11
## Installation
12
12
13
13
To use this gem, install via Bundler by adding the following to your application's `Gemfile`:
14
14
15
+
<!-- x-release-please-start-version -->
16
+
15
17
```ruby
16
-
gem "tilda", "~> 0.0.1"
18
+
gem "tilda-ruby", "~> 0.0.2"
17
19
```
18
20
21
+
<!-- x-release-please-end -->
22
+
19
23
## Usage
20
24
21
25
```ruby
22
26
require"bundler/setup"
23
-
require"tilda"
27
+
require"tilda_ruby"
24
28
25
-
tilda =Tilda::Client.new(
29
+
tilda =TildaRuby::Client.new(
26
30
api_key:ENV["TILDA_API_KEY"] # This is the default and can be omitted
27
31
)
28
32
@@ -33,17 +37,17 @@ puts(getpage)
33
37
34
38
### Handling errors
35
39
36
-
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 `Tilda::Errors::APIError` will be thrown:
40
+
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 `TildaRuby::Errors::APIError` will be thrown:
On timeout, `Tilda::Errors::APITimeoutError` is raised.
104
+
On timeout, `TildaRuby::Errors::APITimeoutError` is raised.
101
105
102
106
Note that requests that time out are retried by default.
103
107
104
108
## Advanced concepts
105
109
106
110
### BaseModel
107
111
108
-
All parameter and response objects inherit from `Tilda::Internal::Type::BaseModel`, which provides several conveniences, including:
112
+
All parameter and response objects inherit from `TildaRuby::Internal::Type::BaseModel`, which provides several conveniences, including:
109
113
110
114
1. All fields, including unknown ones, are accessible with `obj[:prop]` syntax, and can be destructured with `obj => {prop: prop}` or pattern-matching syntax.
111
115
@@ -157,9 +161,9 @@ response = client.request(
157
161
158
162
### Concurrency & connection pooling
159
163
160
-
The `Tilda::Client` instances are threadsafe, but are only are fork-safe when there are no in-flight HTTP requests.
164
+
The `TildaRuby::Client` instances are threadsafe, but are only are fork-safe when there are no in-flight HTTP requests.
161
165
162
-
Each instance of `Tilda::Client` has its own HTTP connection pool with a default size of 99. As such, we recommend instantiating the client once per application in most settings.
166
+
Each instance of `TildaRuby::Client` has its own HTTP connection pool with a default size of 99. As such, we recommend instantiating the client once per application in most settings.
163
167
164
168
When all available connections from the pool are checked out, requests wait for a new connection to become available, with queue time counting towards the request timeout.
0 commit comments