duffel_api 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c46f165ae24365df8a17eb35d99ddb7ffed2a5dc170d84e8258d17c1f120c62f
4
- data.tar.gz: 9e566d5f0b79b9dd13d5ac873f095a575ea4a23c11dbcae00d91f13940816330
3
+ metadata.gz: e8f0c68a903fdbb97b00475752aa584eb9e6b02958b86e01c1cac36868b3cbc9
4
+ data.tar.gz: 2c5758fe469ee2477a547ebf5ce22152a5c84c38cb6c56bdd4ed7ea27d9942d3
5
5
  SHA512:
6
- metadata.gz: e03f1705659ccd04c14cc5d479f8ca13f9ec9a67338eb64aa824a9ac72ee2e21133e0725bc04d7d5772343ce3dc7d4e146184400836535ef49b0edd077b39514
7
- data.tar.gz: f99d04e62d5d518affba0baa592c5f10a118bc1b7cac8bcb1ada16c778a2dceb7e4cc0c16be80bc80be9bd56cf3e7df6e46bc80736019a299db04824ca62ec4c
6
+ metadata.gz: 1cc6896e9c428495b803f798e4d398000e2100e90d428b10acabff186ee4086a7df2bee4e5d35dad08ed52d8091cff0fff7cac2cc465f2c9b67236e6b1e49c36
7
+ data.tar.gz: 46a28cd8797969b9161243a980457ab7b72942feaeb331f8c449dc7c8943a3de1a289326beda6bf6eab5113ff117ca36296f62e77cc340f37e61773cda128273
data/.gitignore CHANGED
@@ -8,3 +8,5 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  .DS_Store
11
+ .ruby-version
12
+ /gemfiles/.bundle/
data/.rubocop.yml CHANGED
@@ -11,6 +11,3 @@ RSpec/ExampleLength:
11
11
 
12
12
  RSpec/MultipleExpectations:
13
13
  Enabled: false
14
-
15
- Rails:
16
- Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [0.4.0] - 2022-02-15
2
+
3
+ - Use the latest API version, `v1`
4
+ - Add airlines' logo URL
5
+
1
6
  ## [0.3.0] - 2022-02-15
2
7
 
3
8
  - Automatically retry rate-limited requests (thanks to @ferrisoxide for the contribution!)
data/Gemfile CHANGED
@@ -6,13 +6,13 @@ source "https://rubygems.org"
6
6
  gemspec
7
7
 
8
8
  group :development, :test do
9
- gem "gc_ruboconfig", "~> 3.0.0"
9
+ gem "gc_ruboconfig", "~> 3.4.0"
10
10
  gem "pry", "~> 0.14.1"
11
11
  gem "rake", "~> 13.0"
12
12
  gem "rspec", "~> 3.11.0"
13
13
  gem "rspec-its", "~> 1.3.0"
14
- gem "rspec_junit_formatter", "~> 0.5.0"
15
- gem "rubocop", "~> 1.25.0"
14
+ gem "rspec_junit_formatter", "~> 0.6.0"
15
+ gem "rubocop", "~> 1.36.0"
16
16
  gem "rubocop-rake", "~> 0.6.0"
17
17
  gem "simplecov", "~> 0.21.2"
18
18
  gem "webmock", "~> 3.14.0"
data/README.md CHANGED
@@ -20,7 +20,7 @@ A Ruby client library for the [Duffel API](https://duffel.com/docs/api).
20
20
  In most cases, you'll want to add `duffel_api` to your project as a dependency by listing it in your `Gemfile`, and then running `bundle`:
21
21
 
22
22
  ```ruby
23
- gem "duffel_api", "~> 0.3.0"
23
+ gem "duffel_api", "~> 0.4.0"
24
24
  ```
25
25
 
26
26
  You can install `duffel_api` outside of the context of a project by running `gem install duffel_api` - for example if you want to play with the client library in `irb`.
@@ -118,7 +118,7 @@ client.offers.
118
118
 
119
119
  A call to `#all` returns a Ruby [`Enumerator`](https://ruby-doc.org/core-2.6/Enumerator.html), which behaves a lot like an array - you can get the number of records with `#length`, loop through it with `#each`, etc.
120
120
 
121
- If you prefer, you can also page through records manually using a service's `#list` method (e.g. `client.orders.list`) which returns a `DuffelAPI::ListResponse`.
121
+ If you prefer, you can also page through records manually using a service's `#list` method (e.g. `client.orders.list`) which returns a `DuffelAPI::ListResponse`.
122
122
 
123
123
  The records in the page are returned by `#records` (`client.orders.list.records`) and the cursor for the next page (if there is one) can be found with `#after` (`client.orders.list.after`)
124
124
 
@@ -242,4 +242,3 @@ end
242
242
 
243
243
  You can find complete documentation on this library's classes and methods in the in-code
244
244
  documentation on [RubyDoc.info](https://rubydoc.info/github/duffelhq/duffel-api-ruby).
245
-
@@ -3,7 +3,7 @@
3
3
  require "duffel_api"
4
4
 
5
5
  client = DuffelAPI::Client.new(
6
- access_token: ENV["DUFFEL_ACCESS_TOKEN"],
6
+ access_token: ENV.fetch("DUFFEL_ACCESS_TOKEN"),
7
7
  )
8
8
 
9
9
  # 365 days from now
@@ -4,7 +4,7 @@ require "duffel_api"
4
4
  require "bigdecimal"
5
5
 
6
6
  client = DuffelAPI::Client.new(
7
- access_token: ENV["DUFFEL_ACCESS_TOKEN"],
7
+ access_token: ENV.fetch("DUFFEL_ACCESS_TOKEN"),
8
8
  )
9
9
 
10
10
  # 365 days from now
@@ -4,7 +4,7 @@ require "duffel_api"
4
4
  require "bigdecimal"
5
5
 
6
6
  client = DuffelAPI::Client.new(
7
- access_token: ENV["DUFFEL_ACCESS_TOKEN"],
7
+ access_token: ENV.fetch("DUFFEL_ACCESS_TOKEN"),
8
8
  )
9
9
 
10
10
  # 365 days from now
@@ -3,7 +3,7 @@
3
3
  require "duffel_api"
4
4
 
5
5
  client = DuffelAPI::Client.new(
6
- access_token: ENV["DUFFEL_ACCESS_TOKEN"],
6
+ access_token: ENV.fetch("DUFFEL_ACCESS_TOKEN"),
7
7
  )
8
8
 
9
9
  puts "Loading airports..."
@@ -3,7 +3,7 @@
3
3
  require "duffel_api"
4
4
 
5
5
  client = DuffelAPI::Client.new(
6
- access_token: ENV["DUFFEL_ACCESS_TOKEN"],
6
+ access_token: ENV.fetch("DUFFEL_ACCESS_TOKEN"),
7
7
  )
8
8
 
9
9
  # 365 days from now
@@ -4,7 +4,7 @@ require "duffel_api"
4
4
  require "bigdecimal"
5
5
 
6
6
  client = DuffelAPI::Client.new(
7
- access_token: ENV["DUFFEL_ACCESS_TOKEN"],
7
+ access_token: ENV.fetch("DUFFEL_ACCESS_TOKEN"),
8
8
  )
9
9
 
10
10
  # 365 days from now
@@ -4,7 +4,7 @@ module DuffelAPI
4
4
  # A client for accessing the Duffel API, configured with a provided access token and
5
5
  # base URL, which provides access to API services
6
6
  class Client
7
- API_VERSION = "beta"
7
+ API_VERSION = "v1"
8
8
 
9
9
  # Sets up the client with your access token
10
10
  #
@@ -13,12 +13,20 @@ module DuffelAPI
13
13
  # @return [String]
14
14
  attr_reader :name
15
15
 
16
+ # @return [String, nil]
17
+ attr_reader :logo_lockup_url
18
+
19
+ # @return [String, nil]
20
+ attr_reader :logo_symbol_url
21
+
16
22
  def initialize(object, response = nil)
17
23
  @object = object
18
24
 
19
25
  @iata_code = object["iata_code"]
20
26
  @id = object["id"]
21
27
  @name = object["name"]
28
+ @logo_lockup_url = object["logo_lockup_url"]
29
+ @logo_symbol_url = object["logo_symbol_url"]
22
30
 
23
31
  super(object, response)
24
32
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DuffelAPI
4
- VERSION = "0.3.0"
4
+ VERSION = "0.4.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: duffel_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Duffel team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-15 00:00:00.000000000 Z
11
+ date: 2022-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base16
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  requirements: []
161
- rubygems_version: 3.2.22
161
+ rubygems_version: 3.2.3
162
162
  signing_key:
163
163
  specification_version: 4
164
164
  summary: A Ruby client for interacting with the Duffel API