hetzner 0.0.2 → 0.0.3

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: 061c4a1417a091e812f2e9feb67d7ecc79b4360ce659b02086724f19b75067bf
4
- data.tar.gz: 7123987a02d815907e6851779cb345060b8719a37806e1bbf8e21fa3645310af
3
+ metadata.gz: 0b5ca0eac03202917aa68fe603eef4121927ee43953ba5b00f7c0fd150906432
4
+ data.tar.gz: dc7c1f2e2084aca567ae95a7006f24ec9ce35650c6fdf6bd86bf9f1f95a13d7a
5
5
  SHA512:
6
- metadata.gz: a06bd9492382929a17d6eefca034b1f4032e1d9853ce83abb296016e17ba40c7c8b0b3e871efda6030026ea53aff55dd5a8220aadc38d9172f0c8cd44d7d6603
7
- data.tar.gz: 17e83861f45a38168d9519e5736c798dc0315afc1440d54a6ac7ace2581d08f9f1d22129fcc3cebe4b5b191a5149ee4fdb22f0a497e04ecbe0d8244cc3d65718
6
+ metadata.gz: d480251d9901c2eedb0c20aa4642313032bc4327927e4a06aff07cf1a54f5e93b067f85915b9aa0b1b5ebf124a89605c296145c2e7751f7806f2af125f8dcafb
7
+ data.tar.gz: f14ec223b9d31434c7e519057b94b1191fc166c18fac47d521f36e8f995bf1bb2ced644c1a1cea810d566a52a9e752a36e8ae6a036c9a1b651214e755fce0980
data/.DS_Store CHANGED
Binary file
@@ -12,20 +12,34 @@ module Hetzner
12
12
  @api_token = api_token
13
13
  end
14
14
 
15
- def list_server_types
15
+ def server_types
16
16
  request(
17
17
  http_method: :get,
18
18
  endpoint: "/server_types"
19
19
  )
20
20
  end
21
21
 
22
+ def server_type(id)
23
+ request(
24
+ http_method: :get,
25
+ endpoint: "/server_types/#{id}"
26
+ )
27
+ end
28
+
29
+ def pricing
30
+ request(
31
+ http_method: :get,
32
+ endpoint: "/pricing"
33
+ )
34
+ end
35
+
22
36
  private
23
37
 
24
38
  def client
25
39
  @_client ||= Faraday.new(API_ENDPOINT) do |client|
26
- client.request :url_encoded
27
- client.adapter Faraday.default_adapter
28
- client.headers['Authorization'] = "Bearer #{api_token}" if api_token.present?
40
+ client.request :url_encoded
41
+ client.adapter Faraday.default_adapter
42
+ client.headers['Authorization'] = "Bearer #{@api_token}" if @api_token.present?
29
43
  end
30
44
  end
31
45
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hetzner
4
- VERSION = "0.0.2"
4
+ VERSION = "0.0.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hetzner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abe Shalash
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-24 00:00:00.000000000 Z
11
+ date: 2021-12-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -52,7 +52,6 @@ files:
52
52
  - Rakefile
53
53
  - bin/console
54
54
  - bin/setup
55
- - hetzner-0.0.1.gem
56
55
  - lib/hetzner.rb
57
56
  - lib/hetzner/client.rb
58
57
  - lib/hetzner/version.rb
data/hetzner-0.0.1.gem DELETED
Binary file