qrcodefyi 0.1.0
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 +7 -0
- data/lib/qrcodefyi/client.rb +76 -0
- data/lib/qrcodefyi/version.rb +5 -0
- data/lib/qrcodefyi.rb +4 -0
- metadata +52 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: f81809c7470995e0e49f0daf4ed32feaacd178db21ccd185cb32428ccecce12a
|
|
4
|
+
data.tar.gz: 20b2eaff033a034ae8224cdca3352ba94b80116fd31bed03fe57a21d5c59c5ba
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: ea4c9c8526012e28d11e4a7dca2abfb37922c35a407c513e1f634d0c4acfdb58718b1d54302f448fee0462e5bef02e8ad28ca66693300c1d4d73aa7e51b385c4
|
|
7
|
+
data.tar.gz: dd8d8347185599d7435b28d4fe6859576f11e685efd106e50d54207bb38843b4e4f0a04e3049d265b4ce64ad1fddf4ce9adef19b920902a5a78ea6c14d3cb17e
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "net/http"
|
|
4
|
+
require "json"
|
|
5
|
+
require "uri"
|
|
6
|
+
|
|
7
|
+
module QRCodeFYI
|
|
8
|
+
class Client
|
|
9
|
+
DEFAULT_BASE_URL = "https://qrcodefyi.com/api"
|
|
10
|
+
|
|
11
|
+
def initialize(base_url: DEFAULT_BASE_URL)
|
|
12
|
+
@base_url = base_url
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def search(query)
|
|
16
|
+
get("/search/", q: query)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def qr_type(slug)
|
|
20
|
+
get("/type/#{slug}/")
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def version(version)
|
|
24
|
+
get("/version/#{version}/")
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def component(slug)
|
|
28
|
+
get("/component/#{slug}/")
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def encoding(slug)
|
|
32
|
+
get("/encoding/#{slug}/")
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def standard(slug)
|
|
36
|
+
get("/standard/#{slug}/")
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def use_case(slug)
|
|
40
|
+
get("/use-case/#{slug}/")
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def glossary_term(slug)
|
|
44
|
+
get("/glossary/#{slug}/")
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def compare(slug_a, slug_b)
|
|
48
|
+
get("/compare/", a: slug_a, b: slug_b)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def random
|
|
52
|
+
get("/random/")
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def openapi
|
|
56
|
+
get("/openapi.json")
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
private
|
|
60
|
+
|
|
61
|
+
def get(path, params = {})
|
|
62
|
+
uri = URI("#{@base_url}#{path}")
|
|
63
|
+
uri.query = URI.encode_www_form(params) unless params.empty?
|
|
64
|
+
|
|
65
|
+
response = Net::HTTP.get_response(uri)
|
|
66
|
+
|
|
67
|
+
unless response.is_a?(Net::HTTPSuccess)
|
|
68
|
+
raise Error, "HTTP #{response.code}: #{response.body}"
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
JSON.parse(response.body, symbolize_names: true)
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
class Error < StandardError; end
|
|
76
|
+
end
|
data/lib/qrcodefyi.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: qrcodefyi
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- FYIPedia
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-03-21 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: API client for qrcodefyi.com. Look up QR code types, versions, encoding
|
|
14
|
+
modes, error correction levels, and standards. Zero dependencies.
|
|
15
|
+
email:
|
|
16
|
+
- hello@fyipedia.com
|
|
17
|
+
executables: []
|
|
18
|
+
extensions: []
|
|
19
|
+
extra_rdoc_files: []
|
|
20
|
+
files:
|
|
21
|
+
- lib/qrcodefyi.rb
|
|
22
|
+
- lib/qrcodefyi/client.rb
|
|
23
|
+
- lib/qrcodefyi/version.rb
|
|
24
|
+
homepage: https://qrcodefyi.com
|
|
25
|
+
licenses:
|
|
26
|
+
- MIT
|
|
27
|
+
metadata:
|
|
28
|
+
homepage_uri: https://qrcodefyi.com
|
|
29
|
+
source_code_uri: https://github.com/fyipedia/qrcodefyi-rb
|
|
30
|
+
changelog_uri: https://github.com/fyipedia/qrcodefyi-rb/blob/main/CHANGELOG.md
|
|
31
|
+
documentation_uri: https://qrcodefyi.com/developers/
|
|
32
|
+
bug_tracker_uri: https://github.com/fyipedia/qrcodefyi-rb/issues
|
|
33
|
+
post_install_message:
|
|
34
|
+
rdoc_options: []
|
|
35
|
+
require_paths:
|
|
36
|
+
- lib
|
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
38
|
+
requirements:
|
|
39
|
+
- - ">="
|
|
40
|
+
- !ruby/object:Gem::Version
|
|
41
|
+
version: '3.0'
|
|
42
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '0'
|
|
47
|
+
requirements: []
|
|
48
|
+
rubygems_version: 3.0.3.1
|
|
49
|
+
signing_key:
|
|
50
|
+
specification_version: 4
|
|
51
|
+
summary: QR code type lookup and standard reference
|
|
52
|
+
test_files: []
|