w3c_api 0.1.0 → 0.1.1
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 +4 -4
- data/LICENSE.md +1 -1
- data/README.adoc +845 -436
- data/lib/w3c_api/cli.rb +20 -20
- data/lib/w3c_api/client.rb +66 -195
- data/lib/w3c_api/commands/affiliation.rb +33 -33
- data/lib/w3c_api/commands/ecosystem.rb +47 -47
- data/lib/w3c_api/commands/group.rb +68 -68
- data/lib/w3c_api/commands/output_formatter.rb +11 -11
- data/lib/w3c_api/commands/participation.rb +20 -22
- data/lib/w3c_api/commands/series.rb +26 -26
- data/lib/w3c_api/commands/specification.rb +77 -52
- data/lib/w3c_api/commands/translation.rb +18 -18
- data/lib/w3c_api/commands/user.rb +60 -60
- data/lib/w3c_api/hal.rb +164 -0
- data/lib/w3c_api/models/account.rb +44 -0
- data/lib/w3c_api/models/affiliation.rb +54 -65
- data/lib/w3c_api/models/affiliation_index.rb +11 -0
- data/lib/w3c_api/models/call_for_translation.rb +15 -39
- data/lib/w3c_api/models/chair_index.rb +11 -0
- data/lib/w3c_api/models/charter.rb +48 -89
- data/lib/w3c_api/models/charter_index.rb +11 -0
- data/lib/w3c_api/models/connected_account.rb +21 -30
- data/lib/w3c_api/models/ecosystem.rb +20 -42
- data/lib/w3c_api/models/{ecosystems.rb → ecosystem_index.rb} +4 -10
- data/lib/w3c_api/models/evangelist_index.rb +11 -0
- data/lib/w3c_api/models/extension.rb +5 -7
- data/lib/w3c_api/models/group.rb +63 -142
- data/lib/w3c_api/models/group_index.rb +12 -0
- data/lib/w3c_api/models/join_emails.rb +5 -7
- data/lib/w3c_api/models/participant_index.rb +11 -0
- data/lib/w3c_api/models/participation.rb +31 -90
- data/lib/w3c_api/models/participation_index.rb +11 -0
- data/lib/w3c_api/models/photo.rb +26 -0
- data/lib/w3c_api/models/serie.rb +21 -51
- data/lib/w3c_api/models/{series.rb → serie_index.rb} +22 -13
- data/lib/w3c_api/models/spec_version.rb +69 -83
- data/lib/w3c_api/models/spec_version_index.rb +13 -0
- data/lib/w3c_api/models/spec_version_ref.rb +11 -13
- data/lib/w3c_api/models/specification.rb +54 -66
- data/lib/w3c_api/models/specification_index.rb +10 -0
- data/lib/w3c_api/models/team_contact_index.rb +11 -0
- data/lib/w3c_api/models/testimonial.rb +17 -0
- data/lib/w3c_api/models/translation.rb +33 -72
- data/lib/w3c_api/models/{translations.rb → translation_index.rb} +4 -12
- data/lib/w3c_api/models/user.rb +95 -165
- data/lib/w3c_api/models/user_index.rb +11 -0
- data/lib/w3c_api/models.rb +35 -12
- data/lib/w3c_api/version.rb +1 -1
- data/lib/w3c_api.rb +3 -2
- metadata +35 -19
- data/lib/w3c_api/models/affiliations.rb +0 -33
- data/lib/w3c_api/models/base.rb +0 -39
- data/lib/w3c_api/models/call_for_translation_ref.rb +0 -15
- data/lib/w3c_api/models/charters.rb +0 -17
- data/lib/w3c_api/models/collection_base.rb +0 -79
- data/lib/w3c_api/models/delegate_enumerable.rb +0 -54
- data/lib/w3c_api/models/groups.rb +0 -38
- data/lib/w3c_api/models/link.rb +0 -17
- data/lib/w3c_api/models/participations.rb +0 -17
- data/lib/w3c_api/models/series_collection.rb +0 -17
- data/lib/w3c_api/models/spec_versions.rb +0 -17
- data/lib/w3c_api/models/specifications.rb +0 -17
- data/lib/w3c_api/models/users.rb +0 -44
@@ -1,10 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'lutaml/model'
|
4
|
-
require_relative 'translation'
|
5
|
-
require_relative 'delegate_enumerable'
|
6
|
-
require_relative 'collection_base'
|
7
|
-
|
8
3
|
# {
|
9
4
|
# "page"=>1,
|
10
5
|
# "limit"=>100,
|
@@ -29,12 +24,9 @@ require_relative 'collection_base'
|
|
29
24
|
# },
|
30
25
|
|
31
26
|
module W3cApi
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
delegate_enumerable :translations
|
37
|
-
collection_instance_class Translation, :translations
|
38
|
-
end
|
27
|
+
module Models
|
28
|
+
class TranslationIndex < Lutaml::Hal::Page
|
29
|
+
hal_link :translations, key: 'translations', realize_class: 'Translation', collection: true
|
39
30
|
end
|
31
|
+
end
|
40
32
|
end
|
data/lib/w3c_api/models/user.rb
CHANGED
@@ -1,178 +1,108 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
require_relative 'connected_account'
|
5
|
-
require_relative 'link'
|
6
|
-
|
3
|
+
# https://api.w3.org/users/f1of1ovb5rydm8s0go04oco0cgk0sow44w
|
7
4
|
# {
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
5
|
+
# "id": 128112,
|
6
|
+
# "name": "Jennifer Strickland",
|
7
|
+
# "given": "Jennifer",
|
8
|
+
# "family": "Strickland",
|
9
|
+
# "country-code": "US",
|
10
|
+
# "connected-accounts": [
|
11
|
+
# {
|
12
|
+
# "created": "2021-03-12T22:06:06+00:00",
|
13
|
+
# "service": "github",
|
14
|
+
# "identifier": "57469",
|
15
|
+
# "nickname": "jenstrickland",
|
16
|
+
# "profile-picture": "https://avatars.githubusercontent.com/u/57469?v=4",
|
17
|
+
# "href": "https://github.com/jenstrickland",
|
18
|
+
# "_links": {
|
19
|
+
# "user": {
|
20
|
+
# "href": "https://api.w3.org/users/f1ovb5rydm8s0go04oco0cgk0sow44w"
|
21
|
+
# }
|
22
|
+
# }
|
23
|
+
# }
|
24
|
+
# ],
|
25
|
+
# "discr": "user",
|
26
|
+
# "_links": {
|
27
|
+
# "self": {
|
28
|
+
# "href": "https://api.w3.org/users/f1ovb5rydm8s0go04oco0cgk0sow44w"
|
29
|
+
# },
|
30
|
+
# "affiliations": {
|
31
|
+
# "href": "https://api.w3.org/users/f1ovb5rydm8s0go04oco0cgk0sow44w/affiliations"
|
32
|
+
# },
|
33
|
+
# "groups": {
|
34
|
+
# "href": "https://api.w3.org/users/f1ovb5rydm8s0go04oco0cgk0sow44w/groups"
|
35
|
+
# },
|
36
|
+
# "specifications": {
|
37
|
+
# "href": "https://api.w3.org/users/f1ovb5rydm8s0go04oco0cgk0sow44w/specifications"
|
38
|
+
# },
|
39
|
+
# "photos": [
|
40
|
+
# {
|
41
|
+
# "href": "https://www.w3.org/thumbnails/360/avatar-images/f1ovb5rydm8s0go04oco0cgk0sow44w.webp?x-version=3",
|
42
|
+
# "name": "large"
|
43
|
+
# },
|
44
|
+
# {
|
45
|
+
# "href": "https://www.w3.org/thumbnails/100/avatar-images/f1ovb5rydm8s0go04oco0cgk0sow44w.webp?x-version=3",
|
46
|
+
# "name": "thumbnail"
|
47
|
+
# },
|
48
|
+
# {
|
49
|
+
# "href": "https://www.w3.org/thumbnails/48/avatar-images/f1ovb5rydm8s0go04oco0cgk0sow44w.webp?x-version=3",
|
50
|
+
# "name": "tiny"
|
51
|
+
# }
|
52
|
+
# ],
|
53
|
+
# "participations": {
|
54
|
+
# "href": "https://api.w3.org/users/f1ovb5rydm8s0go04oco0cgk0sow44w/participations"
|
55
|
+
# },
|
56
|
+
# "chair_of_groups": {
|
57
|
+
# "href": "https://api.w3.org/users/f1ovb5rydm8s0go04oco0cgk0sow44w/chair-of-groups"
|
58
|
+
# },
|
59
|
+
# "team_contact_of_groups": {
|
60
|
+
# "href": "https://api.w3.org/users/f1ovb5rydm8s0go04oco0cgk0sow44w/team-contact-of-groups"
|
25
61
|
# }
|
26
|
-
# }
|
27
|
-
# }
|
28
|
-
# ],
|
29
|
-
# "discr"=>"user",
|
30
|
-
# "_links"=>{
|
31
|
-
# "self"=>{
|
32
|
-
# "href"=>"https://api.w3.org/users/c2yerd5euz48gcw08s44oww8g4oo8w8"
|
33
|
-
# },
|
34
|
-
# "affiliations"=>{
|
35
|
-
# "href"=>"https://api.w3.org/users/c2yerd5euz48gcw08s44oww8g4oo8w8/affiliations"
|
36
|
-
# },
|
37
|
-
# "groups"=>{
|
38
|
-
# "href"=>"https://api.w3.org/users/c2yerd5euz48gcw08s44oww8g4oo8w8/groups"
|
39
|
-
# },
|
40
|
-
# "specifications"=>{
|
41
|
-
# "href"=>"https://api.w3.org/users/c2yerd5euz48gcw08s44oww8g4oo8w8/specifications"
|
42
|
-
# },
|
43
|
-
# "participations"=>{
|
44
|
-
# "href"=>"https://api.w3.org/users/c2yerd5euz48gcw08s44oww8g4oo8w8/participations"
|
45
|
-
# },
|
46
|
-
# "chair_of_groups"=>{
|
47
|
-
# "href"=>"https://api.w3.org/users/c2yerd5euz48gcw08s44oww8g4oo8w8/chair-of-groups"
|
48
|
-
# },
|
49
|
-
# "team_contact_of_groups"=>{
|
50
|
-
# "href"=>"https://api.w3.org/users/c2yerd5euz48gcw08s44oww8g4oo8w8/team-contact-of-groups"
|
51
62
|
# }
|
52
|
-
# }
|
53
63
|
# }
|
54
64
|
|
55
|
-
|
56
|
-
|
57
|
-
# "name": "Stéphane Deschamps",
|
58
|
-
# "given": "Stéphane",
|
59
|
-
# "family": "Deschamps",
|
60
|
-
# "work_title": "Mr.",
|
61
|
-
# "discr": "user",
|
62
|
-
# "biography": "I love accessibility and standards. Don't we all.",
|
63
|
-
# "country_code": "FR",
|
64
|
-
# "city": "Arcueil Cedex",
|
65
|
-
# "_links": {
|
66
|
-
# "self": {
|
67
|
-
# "href": "https://api.w3.org/users/56nw1z8a5uo0sscsgk4kso8g0004008"
|
68
|
-
# },
|
69
|
-
# "affiliations": {
|
70
|
-
# "href": "https://api.w3.org/users/56nw1z8a5uo0sscsgk4kso8g0004008/affiliations"
|
71
|
-
# },
|
72
|
-
# "groups": {
|
73
|
-
# "href": "https://api.w3.org/users/56nw1z8a5uo0sscsgk4kso8g0004008/groups"
|
74
|
-
# },
|
75
|
-
# "specifications": {
|
76
|
-
# "href": "https://api.w3.org/users/56nw1z8a5uo0sscsgk4kso8g0004008/specifications"
|
77
|
-
# },
|
78
|
-
# "participations": {
|
79
|
-
# "href": "https://api.w3.org/users/56nw1z8a5uo0sscsgk4kso8g0004008/participations"
|
80
|
-
# },
|
81
|
-
# "chair_of_groups": {
|
82
|
-
# "href": "https://api.w3.org/users/56nw1z8a5uo0sscsgk4kso8g0004008/chair-of-groups"
|
83
|
-
# },
|
84
|
-
# "team_contact_of_groups": {
|
85
|
-
# "href": "https://api.w3.org/users/56nw1z8a5uo0sscsgk4kso8g0004008/team-contact-of-groups"
|
86
|
-
# }
|
87
|
-
# }
|
88
|
-
# }
|
65
|
+
require_relative 'account'
|
66
|
+
require_relative 'photo'
|
89
67
|
|
90
68
|
module W3cApi
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
def groups(client = nil)
|
127
|
-
return nil unless client && _links&.groups
|
128
|
-
|
129
|
-
client.user_groups(id)
|
130
|
-
end
|
131
|
-
|
132
|
-
# Return specifications this user has contributed to
|
133
|
-
def specifications(client = nil)
|
134
|
-
return nil unless client && _links&.specifications
|
135
|
-
|
136
|
-
client.user_specifications(id)
|
137
|
-
end
|
138
|
-
|
139
|
-
def self.from_response(response)
|
140
|
-
transformed_response = transform_keys(response)
|
141
|
-
|
142
|
-
user = new
|
143
|
-
transformed_response.each do |key, value|
|
144
|
-
case key
|
145
|
-
when :connected_accounts
|
146
|
-
user.connected_accounts = value.map do |account|
|
147
|
-
ConnectedAccount.from_response(account)
|
148
|
-
end
|
149
|
-
when :_links
|
150
|
-
links_data = {}
|
151
|
-
|
152
|
-
# Handle all standard links
|
153
|
-
value.each do |link_name, link_data|
|
154
|
-
next if link_name == :photos
|
155
|
-
|
156
|
-
# Handle photos array separately
|
157
|
-
|
158
|
-
links_data[link_name] = Link.new(href: link_data[:href], title: link_data[:title])
|
159
|
-
end
|
160
|
-
|
161
|
-
# Handle photos if present
|
162
|
-
if value[:photos]
|
163
|
-
photos = value[:photos].map do |photo|
|
164
|
-
UserPhoto.new(href: photo[:href], name: photo[:name])
|
165
|
-
end
|
166
|
-
links_data[:photos] = photos
|
167
|
-
end
|
168
|
-
|
169
|
-
user._links = UserLinks.new(links_data)
|
170
|
-
else
|
171
|
-
user.send("#{key}=", value) if user.respond_to?("#{key}=")
|
172
|
-
end
|
173
|
-
end
|
174
|
-
user
|
69
|
+
module Models
|
70
|
+
# User model representing a W3C user/participant
|
71
|
+
class User < Lutaml::Hal::Resource
|
72
|
+
attribute :id, :string
|
73
|
+
attribute :name, :string
|
74
|
+
attribute :link, :string
|
75
|
+
attribute :given, :string
|
76
|
+
attribute :family, :string
|
77
|
+
attribute :discr, :string
|
78
|
+
attribute :country_code, :string
|
79
|
+
attribute :connected_accounts, Account, collection: true
|
80
|
+
attribute :photos, Photo, collection: true
|
81
|
+
|
82
|
+
hal_link :self, key: 'self', realize_class: 'User'
|
83
|
+
hal_link :affiliations, key: 'affiliations', realize_class: 'AffiliationIndex'
|
84
|
+
hal_link :groups, key: 'groups', realize_class: 'GroupIndex'
|
85
|
+
hal_link :specifications, key: 'specifications', realize_class: 'SpecificationIndex'
|
86
|
+
hal_link :participations, key: 'participations', realize_class: 'ParticipationIndex'
|
87
|
+
hal_link :chair_of_groups, key: 'chair-of-groups', realize_class: 'GroupIndex'
|
88
|
+
hal_link :team_contact_of_groups, key: 'team-contact-of-groups', realize_class: 'GroupIndex'
|
89
|
+
hal_link :photos, key: 'photos', realize_class: 'Photo', collection: true
|
90
|
+
|
91
|
+
key_value do
|
92
|
+
%i[
|
93
|
+
id
|
94
|
+
name
|
95
|
+
link
|
96
|
+
given
|
97
|
+
family
|
98
|
+
discr
|
99
|
+
country_code
|
100
|
+
connected_accounts
|
101
|
+
photos
|
102
|
+
].each do |key|
|
103
|
+
map key.to_s.tr('_', '-'), to: key
|
175
104
|
end
|
176
105
|
end
|
177
106
|
end
|
107
|
+
end
|
178
108
|
end
|
data/lib/w3c_api/models.rb
CHANGED
@@ -1,15 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module W3cApi
|
2
|
-
|
3
|
-
|
4
|
+
module Models
|
5
|
+
end
|
4
6
|
end
|
5
7
|
|
6
|
-
|
7
|
-
require_relative 'models/
|
8
|
-
require_relative 'models/
|
9
|
-
require_relative 'models/
|
10
|
-
require_relative 'models/
|
11
|
-
require_relative 'models/
|
12
|
-
require_relative 'models/
|
13
|
-
require_relative 'models/
|
14
|
-
require_relative 'models/
|
15
|
-
require_relative 'models/
|
8
|
+
# Load specific model implementations
|
9
|
+
require_relative 'models/affiliation'
|
10
|
+
require_relative 'models/affiliation_index'
|
11
|
+
require_relative 'models/call_for_translation'
|
12
|
+
require_relative 'models/charter'
|
13
|
+
require_relative 'models/charter_index'
|
14
|
+
require_relative 'models/chair_index'
|
15
|
+
require_relative 'models/connected_account'
|
16
|
+
require_relative 'models/ecosystem'
|
17
|
+
require_relative 'models/ecosystem_index'
|
18
|
+
require_relative 'models/evangelist_index'
|
19
|
+
require_relative 'models/extension'
|
20
|
+
require_relative 'models/group'
|
21
|
+
require_relative 'models/group_index'
|
22
|
+
require_relative 'models/join_emails'
|
23
|
+
require_relative 'models/participant_index'
|
24
|
+
require_relative 'models/participation'
|
25
|
+
require_relative 'models/participation_index'
|
26
|
+
require_relative 'models/serie'
|
27
|
+
require_relative 'models/serie_index'
|
28
|
+
require_relative 'models/spec_version'
|
29
|
+
require_relative 'models/spec_version_index'
|
30
|
+
require_relative 'models/spec_version_ref'
|
31
|
+
require_relative 'models/specification'
|
32
|
+
require_relative 'models/specification_index'
|
33
|
+
require_relative 'models/team_contact_index'
|
34
|
+
require_relative 'models/testimonial'
|
35
|
+
require_relative 'models/translation'
|
36
|
+
require_relative 'models/translation_index'
|
37
|
+
require_relative 'models/user'
|
38
|
+
require_relative 'models/user_index'
|
data/lib/w3c_api/version.rb
CHANGED
data/lib/w3c_api.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
require 'lutaml/model'
|
4
|
+
require 'lutaml/hal'
|
5
5
|
|
6
6
|
require_relative 'w3c_api/version'
|
7
|
+
require_relative 'w3c_api/hal'
|
7
8
|
require_relative 'w3c_api/models'
|
8
9
|
require_relative 'w3c_api/client'
|
9
10
|
require_relative 'w3c_api/cli'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: w3c_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-03
|
11
|
+
date: 2025-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: lutaml-hal
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: lutaml-model
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,7 +67,7 @@ dependencies:
|
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
70
|
+
name: rainbow
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
73
|
- - ">="
|
@@ -104,38 +118,40 @@ files:
|
|
104
118
|
- lib/w3c_api/commands/specification.rb
|
105
119
|
- lib/w3c_api/commands/translation.rb
|
106
120
|
- lib/w3c_api/commands/user.rb
|
121
|
+
- lib/w3c_api/hal.rb
|
107
122
|
- lib/w3c_api/models.rb
|
123
|
+
- lib/w3c_api/models/account.rb
|
108
124
|
- lib/w3c_api/models/affiliation.rb
|
109
|
-
- lib/w3c_api/models/
|
110
|
-
- lib/w3c_api/models/base.rb
|
125
|
+
- lib/w3c_api/models/affiliation_index.rb
|
111
126
|
- lib/w3c_api/models/call_for_translation.rb
|
112
|
-
- lib/w3c_api/models/
|
127
|
+
- lib/w3c_api/models/chair_index.rb
|
113
128
|
- lib/w3c_api/models/charter.rb
|
114
|
-
- lib/w3c_api/models/
|
115
|
-
- lib/w3c_api/models/collection_base.rb
|
129
|
+
- lib/w3c_api/models/charter_index.rb
|
116
130
|
- lib/w3c_api/models/connected_account.rb
|
117
|
-
- lib/w3c_api/models/delegate_enumerable.rb
|
118
131
|
- lib/w3c_api/models/ecosystem.rb
|
119
|
-
- lib/w3c_api/models/
|
132
|
+
- lib/w3c_api/models/ecosystem_index.rb
|
133
|
+
- lib/w3c_api/models/evangelist_index.rb
|
120
134
|
- lib/w3c_api/models/extension.rb
|
121
135
|
- lib/w3c_api/models/group.rb
|
122
|
-
- lib/w3c_api/models/
|
136
|
+
- lib/w3c_api/models/group_index.rb
|
123
137
|
- lib/w3c_api/models/join_emails.rb
|
124
|
-
- lib/w3c_api/models/
|
138
|
+
- lib/w3c_api/models/participant_index.rb
|
125
139
|
- lib/w3c_api/models/participation.rb
|
126
|
-
- lib/w3c_api/models/
|
140
|
+
- lib/w3c_api/models/participation_index.rb
|
141
|
+
- lib/w3c_api/models/photo.rb
|
127
142
|
- lib/w3c_api/models/serie.rb
|
128
|
-
- lib/w3c_api/models/
|
129
|
-
- lib/w3c_api/models/series_collection.rb
|
143
|
+
- lib/w3c_api/models/serie_index.rb
|
130
144
|
- lib/w3c_api/models/spec_version.rb
|
145
|
+
- lib/w3c_api/models/spec_version_index.rb
|
131
146
|
- lib/w3c_api/models/spec_version_ref.rb
|
132
|
-
- lib/w3c_api/models/spec_versions.rb
|
133
147
|
- lib/w3c_api/models/specification.rb
|
134
|
-
- lib/w3c_api/models/
|
148
|
+
- lib/w3c_api/models/specification_index.rb
|
149
|
+
- lib/w3c_api/models/team_contact_index.rb
|
150
|
+
- lib/w3c_api/models/testimonial.rb
|
135
151
|
- lib/w3c_api/models/translation.rb
|
136
|
-
- lib/w3c_api/models/
|
152
|
+
- lib/w3c_api/models/translation_index.rb
|
137
153
|
- lib/w3c_api/models/user.rb
|
138
|
-
- lib/w3c_api/models/
|
154
|
+
- lib/w3c_api/models/user_index.rb
|
139
155
|
- lib/w3c_api/version.rb
|
140
156
|
homepage: https://github.com/relaton/w3c-api
|
141
157
|
licenses:
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'lutaml/model'
|
4
|
-
require_relative 'affiliation'
|
5
|
-
require_relative 'delegate_enumerable'
|
6
|
-
require_relative 'collection_base'
|
7
|
-
|
8
|
-
# {
|
9
|
-
# "page"=>1,
|
10
|
-
# "limit"=>1000,
|
11
|
-
# "pages"=>16,
|
12
|
-
# "total"=>15918,
|
13
|
-
# "_links"=>{
|
14
|
-
# "affiliations"=>[
|
15
|
-
# {
|
16
|
-
# "href"=>"https://api.w3.org/affiliations/1001",
|
17
|
-
# "title"=>"Framkom (Forskningsaktiebolaget Medie-och Kommunikationsteknik)"
|
18
|
-
# },
|
19
|
-
# {
|
20
|
-
# "href"=>"https://api.w3.org/affiliations/1003",
|
21
|
-
# "title"=>"BackWeb Technologies, Inc."
|
22
|
-
# },
|
23
|
-
|
24
|
-
module W3cApi
|
25
|
-
module Models
|
26
|
-
class Affiliations < CollectionBase
|
27
|
-
attribute :affiliations, Affiliation, collection: true
|
28
|
-
|
29
|
-
delegate_enumerable :affiliations
|
30
|
-
collection_instance_class Affiliation, :affiliations
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
data/lib/w3c_api/models/base.rb
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'lutaml/model'
|
4
|
-
require 'json'
|
5
|
-
require 'yaml'
|
6
|
-
|
7
|
-
module W3cApi
|
8
|
-
module Models
|
9
|
-
class Base < Lutaml::Model::Serializable
|
10
|
-
# Common methods for all W3C API models
|
11
|
-
|
12
|
-
# Create a model instance from a JSON hash
|
13
|
-
def self.from_response(data)
|
14
|
-
# Convert keys with hyphens to snake_case for Ruby
|
15
|
-
transformed_data = transform_keys(data)
|
16
|
-
|
17
|
-
# Create model instance
|
18
|
-
new(transformed_data)
|
19
|
-
end
|
20
|
-
|
21
|
-
# Utility function to transform kebab-case to snake_case
|
22
|
-
def self.transform_keys(data)
|
23
|
-
case data
|
24
|
-
when Hash
|
25
|
-
result = {}
|
26
|
-
data.each do |key, value|
|
27
|
-
snake_key = key.to_s.tr('-', '_').to_sym
|
28
|
-
result[snake_key] = transform_keys(value)
|
29
|
-
end
|
30
|
-
result
|
31
|
-
when Array
|
32
|
-
data.map { |item| transform_keys(item) }
|
33
|
-
else
|
34
|
-
data
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'lutaml/model'
|
4
|
-
require_relative 'spec_version_ref'
|
5
|
-
|
6
|
-
module W3cApi
|
7
|
-
module Models
|
8
|
-
class CallForTranslationRef < Lutaml::Model::Serializable
|
9
|
-
attribute :uri, :string
|
10
|
-
attribute :title, :string
|
11
|
-
attribute :comments, :string
|
12
|
-
attribute :spec_version, SpecVersionRef
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'lutaml/model'
|
4
|
-
require_relative 'charter'
|
5
|
-
require_relative 'delegate_enumerable'
|
6
|
-
require_relative 'collection_base'
|
7
|
-
|
8
|
-
module W3cApi
|
9
|
-
module Models
|
10
|
-
class Charters < CollectionBase
|
11
|
-
attribute :charters, Charter, collection: true
|
12
|
-
|
13
|
-
delegate_enumerable :charters
|
14
|
-
collection_instance_class Charter, :charters
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|