velnod 0.1.3 β†’ 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 21680c98a0d0c31c80dd38da08e11ff1acaa5d86a037732bdc05014c750f177c
4
- data.tar.gz: '0910b1ab17541b6a4787cdcfc1f81ed7ea2b3f7b1da9a6a9842e0510352c331d'
3
+ metadata.gz: 6faf82e530ff03f50440cb07f595c173bcdf0d4524e4b9025a712326eb4cb4d4
4
+ data.tar.gz: 9fe4125d10c97d944f5189a3db0d696370979e503882825ae415ee2625536a89
5
5
  SHA512:
6
- metadata.gz: ea507b75a94f11687bc995f8a394250d472aff14864b8e7835e0b60ff9ef4d34fb83eb81f1fc33c3b75be0dcba01b1ea4bd55e67cb8c245ae590fcdfe3dcc52e
7
- data.tar.gz: eeff55d5490f400d293de578909b6173c36a9f19ac451551d479e03622514929dc4bf5bf1c0d4af2c4941c9df390460d222621949abfb23340ee57c659bc84ad
6
+ metadata.gz: af9a71a046897deb824665f786a5f80375a887340ddcb73adac9e84ffb24a89f5ad9676a2244e06e90578bbf3df108683d1f0ee2503db80c638fcd2a3cc2daba
7
+ data.tar.gz: 65fc45cf0ee3b6dbd01f1db9d5a0dfd30d3811e916f1cdea65942abec01f6b9c2f01173bec345e57af9cf11afbf442f24a41d202352f8d00393ceb5016aa996d
data/README.md CHANGED
@@ -48,3 +48,45 @@ Returns a hash with the results:
48
48
  }
49
49
  ```
50
50
 
51
+ ## Countries
52
+
53
+ ```ruby
54
+ # Get all countries
55
+ Velnod.countries.all
56
+
57
+ # Find a country by alpha2, alpha3, or ID
58
+ Velnod.countries.find("US")
59
+ Velnod.countries.find("USA")
60
+ Velnod.countries.find("1234567890")
61
+
62
+ # Filter by region
63
+ Velnod.countries.by_region("Europe")
64
+
65
+ # Search by name
66
+ Velnod.countries.search("united")
67
+
68
+ # Combine filters
69
+ Velnod.countries.all(region: "Europe", subregion: "Western Europe", q: "germany")
70
+ ```
71
+
72
+ Returns country data:
73
+
74
+ ```ruby
75
+ {
76
+ "id" => "1234567890",
77
+ "common_name" => "United States",
78
+ "iso_short_name" => "United States of America",
79
+ "iso_long_name" => "The United States of America",
80
+ "iso_alpha2" => "US",
81
+ "iso_alpha3" => "USA",
82
+ "phone_code" => "1",
83
+ "currency_code" => "USD",
84
+ "currency_symbol" => "$",
85
+ "region" => "Americas",
86
+ "subregion" => "Northern America",
87
+ "flag_emoji" => "πŸ‡ΊπŸ‡Έ",
88
+ "languages" => ["en"],
89
+ "timezones" => ["America/New_York", "America/Los_Angeles", ...]
90
+ }
91
+ ```
92
+
data/lib/velnod/client.rb CHANGED
@@ -17,6 +17,20 @@ module Velnod
17
17
  @check ||= Resources::Check.new(self)
18
18
  end
19
19
 
20
+ def countries
21
+ @countries ||= Resources::Countries.new(self)
22
+ end
23
+
24
+ def get(path, params = {})
25
+ uri = URI("#{@base_url}#{path}")
26
+ uri.query = URI.encode_www_form(params) if params.any?
27
+
28
+ request = Net::HTTP::Get.new(uri)
29
+ request["Authorization"] = "Bearer #{@api_key}"
30
+
31
+ make_request(uri, request)
32
+ end
33
+
20
34
  def post(path, body = {})
21
35
  uri = URI("#{@base_url}#{path}")
22
36
 
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Velnod
4
+ module Resources
5
+ class Countries
6
+ def initialize(client)
7
+ @client = client
8
+ end
9
+
10
+ def all(region: nil, subregion: nil, independent: nil, q: nil)
11
+ params = {}
12
+ params[:region] = region if region
13
+ params[:subregion] = subregion if subregion
14
+ params[:independent] = independent unless independent.nil?
15
+ params[:q] = q if q
16
+
17
+ @client.get("/countries", params)
18
+ end
19
+
20
+ def find(code)
21
+ @client.get("/countries/#{code}")
22
+ end
23
+
24
+ def by_region(region)
25
+ all(region: region)
26
+ end
27
+
28
+ def search(query)
29
+ all(q: query)
30
+ end
31
+ end
32
+ end
33
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Velnod
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.5"
5
5
  end
data/lib/velnod.rb CHANGED
@@ -4,6 +4,7 @@ require_relative "velnod/version"
4
4
  require_relative "velnod/configuration"
5
5
  require_relative "velnod/client"
6
6
  require_relative "velnod/resources/check"
7
+ require_relative "velnod/resources/countries"
7
8
 
8
9
  module Velnod
9
10
  class Error < StandardError; end
@@ -16,5 +17,9 @@ module Velnod
16
17
  def check(email: nil, domain: nil, name: nil)
17
18
  client.check.call(email: email, domain: domain, name: name)
18
19
  end
20
+
21
+ def countries
22
+ client.countries
23
+ end
19
24
  end
20
25
  end
data/velnod-0.1.3.gem ADDED
Binary file
data/velnod-0.1.4.gem ADDED
Binary file
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: velnod
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - samuenti
8
+ autorequire:
8
9
  bindir: exe
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2026-01-02 00:00:00.000000000 Z
11
12
  dependencies: []
12
13
  description: Simple Ruby client to check emails, domains, and names against the Velnod
13
14
  API
@@ -24,17 +25,21 @@ files:
24
25
  - lib/velnod/client.rb
25
26
  - lib/velnod/configuration.rb
26
27
  - lib/velnod/resources/check.rb
28
+ - lib/velnod/resources/countries.rb
27
29
  - lib/velnod/version.rb
28
30
  - sig/velnod.rbs
29
31
  - velnod-0.1.0.gem
30
32
  - velnod-0.1.1.gem
31
33
  - velnod-0.1.2.gem
34
+ - velnod-0.1.3.gem
35
+ - velnod-0.1.4.gem
32
36
  homepage: https://velnod.com
33
37
  licenses:
34
38
  - MIT
35
39
  metadata:
36
40
  allowed_push_host: https://rubygems.org
37
41
  homepage_uri: https://velnod.com
42
+ post_install_message:
38
43
  rdoc_options: []
39
44
  require_paths:
40
45
  - lib
@@ -49,7 +54,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
49
54
  - !ruby/object:Gem::Version
50
55
  version: '0'
51
56
  requirements: []
52
- rubygems_version: 3.6.9
57
+ rubygems_version: 3.4.19
58
+ signing_key:
53
59
  specification_version: 4
54
60
  summary: Ruby client for the Velnod API
55
61
  test_files: []