w3c_api 0.1.4 → 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 +4 -4
- data/.rubocop.yml +16 -1
- data/.rubocop_todo.yml +20 -38
- data/README.adoc +51 -0
- data/Rakefile +3 -3
- data/demo/rate_limiting_demo.rb +135 -0
- data/demo/test_embed_functionality.rb +31 -30
- data/demo/test_improved_embed_functionality.rb +92 -0
- data/examples/rate_limiting_stress_test.rb +239 -0
- data/exe/w3c_api +1 -1
- data/lib/w3c_api/cli.rb +29 -28
- data/lib/w3c_api/client.rb +8 -7
- data/lib/w3c_api/commands/affiliation.rb +15 -12
- data/lib/w3c_api/commands/ecosystem.rb +22 -15
- data/lib/w3c_api/commands/group.rb +32 -25
- data/lib/w3c_api/commands/output_formatter.rb +1 -1
- data/lib/w3c_api/commands/participation.rb +11 -9
- data/lib/w3c_api/commands/series.rb +11 -9
- data/lib/w3c_api/commands/specification.rb +59 -45
- data/lib/w3c_api/commands/specification_version.rb +21 -12
- data/lib/w3c_api/commands/translation.rb +7 -6
- data/lib/w3c_api/commands/user.rb +36 -24
- data/lib/w3c_api/embed.rb +7 -7
- data/lib/w3c_api/hal.rb +168 -133
- data/lib/w3c_api/models/account.rb +3 -3
- data/lib/w3c_api/models/affiliation.rb +8 -7
- data/lib/w3c_api/models/affiliation_index.rb +3 -2
- data/lib/w3c_api/models/call_for_translation.rb +4 -3
- data/lib/w3c_api/models/chair_index.rb +2 -2
- data/lib/w3c_api/models/charter.rb +5 -5
- data/lib/w3c_api/models/charter_index.rb +3 -2
- data/lib/w3c_api/models/connected_account.rb +2 -2
- data/lib/w3c_api/models/deliverer_index.rb +3 -2
- data/lib/w3c_api/models/ecosystem.rb +8 -6
- data/lib/w3c_api/models/ecosystem_index.rb +3 -2
- data/lib/w3c_api/models/editor_index.rb +2 -2
- data/lib/w3c_api/models/evangelist_index.rb +3 -2
- data/lib/w3c_api/models/group.rb +16 -13
- data/lib/w3c_api/models/group_index.rb +2 -2
- data/lib/w3c_api/models/groups.rb +2 -2
- data/lib/w3c_api/models/participant_index.rb +3 -2
- data/lib/w3c_api/models/participation.rb +6 -5
- data/lib/w3c_api/models/participation_index.rb +3 -2
- data/lib/w3c_api/models/photo.rb +1 -1
- data/lib/w3c_api/models/serie.rb +6 -4
- data/lib/w3c_api/models/serie_index.rb +3 -2
- data/lib/w3c_api/models/spec_version.rb +10 -7
- data/lib/w3c_api/models/spec_version_index.rb +3 -2
- data/lib/w3c_api/models/spec_version_predecessor_index.rb +3 -2
- data/lib/w3c_api/models/spec_version_successor_index.rb +3 -2
- data/lib/w3c_api/models/specification.rb +17 -9
- data/lib/w3c_api/models/specification_index.rb +3 -2
- data/lib/w3c_api/models/team_contact_index.rb +3 -2
- data/lib/w3c_api/models/testimonial.rb +2 -2
- data/lib/w3c_api/models/translation.rb +4 -4
- data/lib/w3c_api/models/translation_index.rb +3 -2
- data/lib/w3c_api/models/user.rb +16 -11
- data/lib/w3c_api/models/user_index.rb +2 -2
- data/lib/w3c_api/models.rb +52 -37
- data/lib/w3c_api/version.rb +1 -1
- data/lib/w3c_api.rb +8 -8
- metadata +8 -5
@@ -1,12 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "affiliation"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
# Represents a collection of W3C affiliations.
|
8
8
|
class AffiliationIndex < Lutaml::Hal::Page
|
9
|
-
hal_link :affiliations, key:
|
9
|
+
hal_link :affiliations, key: "affiliations",
|
10
|
+
realize_class: "Affiliation", collection: true
|
10
11
|
end
|
11
12
|
end
|
12
13
|
end
|
@@ -19,15 +19,16 @@ module W3cApi
|
|
19
19
|
attribute :uri, :string
|
20
20
|
attribute :title, :string
|
21
21
|
|
22
|
-
hal_link :self, key:
|
23
|
-
hal_link :translations, key:
|
22
|
+
hal_link :self, key: "self", realize_class: "CallForTranslation"
|
23
|
+
hal_link :translations, key: "translations",
|
24
|
+
realize_class: "TranslationIndex"
|
24
25
|
|
25
26
|
key_value do
|
26
27
|
%i[
|
27
28
|
uri
|
28
29
|
title
|
29
30
|
].each do |key|
|
30
|
-
map key.to_s.tr(
|
31
|
+
map key.to_s.tr("_", "-"), to: key
|
31
32
|
end
|
32
33
|
end
|
33
34
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "user"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
class ChairIndex < Lutaml::Hal::Page
|
8
|
-
hal_link :chairs, key:
|
8
|
+
hal_link :chairs, key: "chairs", realize_class: "User", collection: true
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "extension"
|
4
4
|
|
5
5
|
# https://api.w3.org/groups/109735/charters/361
|
6
6
|
# {
|
@@ -45,9 +45,9 @@ module W3cApi
|
|
45
45
|
attribute :required_new_commitments, :boolean
|
46
46
|
attribute :patent_policy, :string
|
47
47
|
|
48
|
-
hal_link :self, key:
|
49
|
-
hal_link :group, key:
|
50
|
-
hal_link :next_charter, key:
|
48
|
+
hal_link :self, key: "self", realize_class: "Charter"
|
49
|
+
hal_link :group, key: "group", realize_class: "Group"
|
50
|
+
hal_link :next_charter, key: "next-charter", realize_class: "Charter"
|
51
51
|
|
52
52
|
key_value do
|
53
53
|
%i[
|
@@ -61,7 +61,7 @@ module W3cApi
|
|
61
61
|
required_new_commitments
|
62
62
|
patent_policy
|
63
63
|
].each do |key|
|
64
|
-
map key.to_s.tr(
|
64
|
+
map key.to_s.tr("_", "-"), to: key
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "charter"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
class CharterIndex < Lutaml::Hal::Page
|
8
|
-
hal_link :charters, key:
|
8
|
+
hal_link :charters, key: "charters", realize_class: "Charter",
|
9
|
+
collection: true
|
9
10
|
end
|
10
11
|
end
|
11
12
|
end
|
@@ -26,7 +26,7 @@ module W3cApi
|
|
26
26
|
attribute :profile_picture, :string
|
27
27
|
attribute :href, :string
|
28
28
|
|
29
|
-
hal_link :user, key:
|
29
|
+
hal_link :user, key: "user", realize_class: "User"
|
30
30
|
|
31
31
|
key_value do
|
32
32
|
%i[
|
@@ -37,7 +37,7 @@ module W3cApi
|
|
37
37
|
nickname
|
38
38
|
profile_picture
|
39
39
|
].each do |key|
|
40
|
-
map key.to_s.tr(
|
40
|
+
map key.to_s.tr("_", "-"), to: key
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
@@ -1,12 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "group"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
# Collection of deliverers (working groups)
|
8
8
|
class DelivererIndex < Lutaml::Hal::Page
|
9
|
-
hal_link :deliverers, key:
|
9
|
+
hal_link :deliverers, key: "deliverers", realize_class: "Group",
|
10
|
+
collection: true
|
10
11
|
end
|
11
12
|
end
|
12
13
|
end
|
@@ -31,18 +31,20 @@ module W3cApi
|
|
31
31
|
attribute :href, :string
|
32
32
|
attribute :title, :string
|
33
33
|
|
34
|
-
hal_link :self, key:
|
35
|
-
hal_link :champion, key:
|
36
|
-
hal_link :evangelists, key:
|
37
|
-
|
38
|
-
hal_link :
|
34
|
+
hal_link :self, key: "self", realize_class: "Ecosystem"
|
35
|
+
hal_link :champion, key: "champion", realize_class: "User"
|
36
|
+
hal_link :evangelists, key: "evangelists",
|
37
|
+
realize_class: "EvangelistIndex"
|
38
|
+
hal_link :groups, key: "groups", realize_class: "GroupIndex"
|
39
|
+
hal_link :member_organizations, key: "member-organizations",
|
40
|
+
realize_class: "AffiliationIndex"
|
39
41
|
|
40
42
|
key_value do
|
41
43
|
%i[
|
42
44
|
name
|
43
45
|
shortname
|
44
46
|
].each do |key|
|
45
|
-
map key.to_s.tr(
|
47
|
+
map key.to_s.tr("_", "-"), to: key
|
46
48
|
end
|
47
49
|
end
|
48
50
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "ecosystem"
|
4
4
|
|
5
5
|
# {
|
6
6
|
# "page": 1,
|
@@ -21,7 +21,8 @@ require_relative 'ecosystem'
|
|
21
21
|
module W3cApi
|
22
22
|
module Models
|
23
23
|
class EcosystemIndex < Lutaml::Hal::Page
|
24
|
-
hal_link :ecosystems, key:
|
24
|
+
hal_link :ecosystems, key: "ecosystems", realize_class: "Ecosystem",
|
25
|
+
collection: true
|
25
26
|
end
|
26
27
|
end
|
27
28
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "user"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
# Collection of editors
|
8
8
|
class EditorIndex < Lutaml::Hal::Page
|
9
|
-
hal_link :editors, key:
|
9
|
+
hal_link :editors, key: "editors", realize_class: "User", collection: true
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "user"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
class EvangelistIndex < Lutaml::Hal::Page
|
8
|
-
hal_link :evangelists, key:
|
8
|
+
hal_link :evangelists, key: "evangelists", realize_class: "User",
|
9
|
+
collection: true
|
9
10
|
end
|
10
11
|
end
|
11
12
|
end
|
data/lib/w3c_api/models/group.rb
CHANGED
@@ -5,7 +5,8 @@
|
|
5
5
|
# "id": 109735,
|
6
6
|
# "name": "Immersive Web Working Group",
|
7
7
|
# "is_closed": false,
|
8
|
-
# "description": "The mission of the Immersive Web Working Group is to help bring high-performance Virtual Reality (VR) and Augmented Reality (AR)
|
8
|
+
# "description": "The mission of the Immersive Web Working Group is to help bring high-performance Virtual Reality (VR) and Augmented Reality (AR) " \
|
9
|
+
# "(collectively known as XR) to the open Web via APIs to interact with XR devices and sensors in browsers.",
|
9
10
|
# "shortname": "immersive-web",
|
10
11
|
# "discr": "w3cgroup",
|
11
12
|
# "_links": {
|
@@ -63,18 +64,20 @@ module W3cApi
|
|
63
64
|
attribute :shortname, :string
|
64
65
|
attribute :discr, :string
|
65
66
|
|
66
|
-
hal_link :self, key:
|
67
|
-
hal_link :homepage, key:
|
68
|
-
hal_link :users, key:
|
67
|
+
hal_link :self, key: "self", realize_class: "Group"
|
68
|
+
hal_link :homepage, key: "homepage", realize_class: "String"
|
69
|
+
hal_link :users, key: "users", realize_class: "UserIndex"
|
69
70
|
# hal_link :services, key: 'services', realize_class: 'ServiceIndex'
|
70
|
-
hal_link :specifications, key:
|
71
|
-
|
72
|
-
hal_link :
|
73
|
-
hal_link :
|
74
|
-
hal_link :
|
75
|
-
hal_link :
|
76
|
-
hal_link :
|
77
|
-
hal_link :
|
71
|
+
hal_link :specifications, key: "specifications",
|
72
|
+
realize_class: "SpecificationIndex"
|
73
|
+
hal_link :chairs, key: "chairs", realize_class: "UserIndex"
|
74
|
+
hal_link :team_contacts, key: "team-contacts", realize_class: "UserIndex"
|
75
|
+
hal_link :charters, key: "charters", realize_class: "CharterIndex"
|
76
|
+
hal_link :active_charters, key: "active-charter", realize_class: "Charter"
|
77
|
+
hal_link :join, key: "join", realize_class: "String"
|
78
|
+
hal_link :pp_status, key: "pp-status", realize_class: "String"
|
79
|
+
hal_link :participations, key: "participations",
|
80
|
+
realize_class: "ParticipationIndex"
|
78
81
|
|
79
82
|
key_value do
|
80
83
|
%i[
|
@@ -86,7 +89,7 @@ module W3cApi
|
|
86
89
|
shortname
|
87
90
|
discr
|
88
91
|
].each do |key|
|
89
|
-
map key.to_s.tr(
|
92
|
+
map key.to_s.tr("_", "-"), to: key
|
90
93
|
end
|
91
94
|
end
|
92
95
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "group"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
# Collection of groups
|
8
8
|
class GroupIndex < Lutaml::Hal::Page
|
9
|
-
hal_link :groups, key:
|
9
|
+
hal_link :groups, key: "groups", realize_class: "Group", collection: true
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "user"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
class ParticipantIndex < Lutaml::Hal::Page
|
8
|
-
hal_link :participants, key:
|
8
|
+
hal_link :participants, key: "participants", realize_class: "User",
|
9
|
+
collection: true
|
9
10
|
end
|
10
11
|
end
|
11
12
|
end
|
@@ -31,10 +31,11 @@ module W3cApi
|
|
31
31
|
attribute :individual, :boolean
|
32
32
|
attribute :invited_expert, :boolean
|
33
33
|
|
34
|
-
hal_link :self, key:
|
35
|
-
hal_link :group, key:
|
36
|
-
hal_link :organization, key:
|
37
|
-
hal_link :participants, key:
|
34
|
+
hal_link :self, key: "self", realize_class: "Participation"
|
35
|
+
hal_link :group, key: "group", realize_class: "Group"
|
36
|
+
hal_link :organization, key: "organization", realize_class: "Affiliation"
|
37
|
+
hal_link :participants, key: "participants",
|
38
|
+
realize_class: "ParticipantIndex"
|
38
39
|
|
39
40
|
key_value do
|
40
41
|
%i[
|
@@ -42,7 +43,7 @@ module W3cApi
|
|
42
43
|
invited_expert
|
43
44
|
created
|
44
45
|
].each do |key|
|
45
|
-
map key.to_s.tr(
|
46
|
+
map key.to_s.tr("_", "-"), to: key
|
46
47
|
end
|
47
48
|
end
|
48
49
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "participation"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
class ParticipationIndex < Lutaml::Hal::Page
|
8
|
-
hal_link :participations, key:
|
8
|
+
hal_link :participations, key: "participations",
|
9
|
+
realize_class: "Participation", collection: true
|
9
10
|
end
|
10
11
|
end
|
11
12
|
end
|
data/lib/w3c_api/models/photo.rb
CHANGED
data/lib/w3c_api/models/serie.rb
CHANGED
@@ -41,16 +41,18 @@ module W3cApi
|
|
41
41
|
attribute :href, :string
|
42
42
|
attribute :title, :string
|
43
43
|
|
44
|
-
hal_link :self, key:
|
45
|
-
hal_link :specifications, key:
|
46
|
-
|
44
|
+
hal_link :self, key: "self", realize_class: "Serie"
|
45
|
+
hal_link :specifications, key: "specifications",
|
46
|
+
realize_class: "SpecificationIndex"
|
47
|
+
hal_link :current_specification, key: "current-specification",
|
48
|
+
realize_class: "SpecVersion"
|
47
49
|
|
48
50
|
key_value do
|
49
51
|
%i[
|
50
52
|
shortname
|
51
53
|
name
|
52
54
|
].each do |key|
|
53
|
-
map key.to_s.tr(
|
55
|
+
map key.to_s.tr("_", "-"), to: key
|
54
56
|
end
|
55
57
|
end
|
56
58
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "serie"
|
4
4
|
|
5
5
|
# https://api.w3.org/specification-series
|
6
6
|
# {
|
@@ -44,7 +44,8 @@ require_relative 'serie'
|
|
44
44
|
module W3cApi
|
45
45
|
module Models
|
46
46
|
class SerieIndex < Lutaml::Hal::Page
|
47
|
-
hal_link :series, key:
|
47
|
+
hal_link :series, key: "specification-series", realize_class: "Serie",
|
48
|
+
collection: true
|
48
49
|
end
|
49
50
|
end
|
50
51
|
end
|
@@ -48,12 +48,15 @@ module W3cApi
|
|
48
48
|
attribute :errata, :string
|
49
49
|
attribute :process_rules, :string
|
50
50
|
|
51
|
-
hal_link :self, key:
|
52
|
-
hal_link :editors, key:
|
53
|
-
hal_link :deliverers, key:
|
54
|
-
hal_link :specification, key:
|
55
|
-
|
56
|
-
hal_link :
|
51
|
+
hal_link :self, key: "self", realize_class: "SpecVersion"
|
52
|
+
hal_link :editors, key: "editors", realize_class: "EditorIndex"
|
53
|
+
hal_link :deliverers, key: "deliverers", realize_class: "DelivererIndex"
|
54
|
+
hal_link :specification, key: "specification",
|
55
|
+
realize_class: "Specification"
|
56
|
+
hal_link :predecessor_versions, key: "predecessor-version",
|
57
|
+
realize_class: "SpecVersionPredecessorIndex"
|
58
|
+
hal_link :successor_versions, key: "successor-version",
|
59
|
+
realize_class: "SpecVersionSuccessorIndex"
|
57
60
|
|
58
61
|
key_value do
|
59
62
|
%i[
|
@@ -74,7 +77,7 @@ module W3cApi
|
|
74
77
|
errata
|
75
78
|
process_rules
|
76
79
|
].each do |key|
|
77
|
-
map key.to_s.tr(
|
80
|
+
map key.to_s.tr("_", "-"), to: key
|
78
81
|
end
|
79
82
|
end
|
80
83
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "spec_version"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
class SpecVersionIndex < Lutaml::Hal::Page
|
8
|
-
hal_link :spec_versions, key:
|
8
|
+
hal_link :spec_versions, key: "version-history",
|
9
|
+
realize_class: "SpecVersion", collection: true
|
9
10
|
end
|
10
11
|
end
|
11
12
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "spec_version"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
class SpecVersionPredecessorIndex < Lutaml::Hal::Page
|
8
|
-
hal_link :predecessor_versions, key:
|
8
|
+
hal_link :predecessor_versions, key: "predecessor-version",
|
9
|
+
realize_class: "SpecVersion", collection: true
|
9
10
|
end
|
10
11
|
end
|
11
12
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "spec_version"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
class SpecVersionSuccessorIndex < Lutaml::Hal::Page
|
8
|
-
hal_link :successor_versions, key:
|
8
|
+
hal_link :successor_versions, key: "successor-version",
|
9
|
+
realize_class: "SpecVersion", collection: true
|
9
10
|
end
|
10
11
|
end
|
11
12
|
end
|
@@ -3,7 +3,10 @@
|
|
3
3
|
# https://api.w3.org/specifications/html5
|
4
4
|
# {
|
5
5
|
# "shortlink": "https://www.w3.org/TR/html5/",
|
6
|
-
# "description": "<p>This specification defines the 5th major revision of the core language of the World Wide Web: the Hypertext Markup Language (HTML).
|
6
|
+
# "description": "<p>This specification defines the 5th major revision of the core language of the World Wide Web: the Hypertext Markup Language (HTML). " \
|
7
|
+
# "In this version, new features are introduced to help Web application authors, new elements are introduced based on research " \
|
8
|
+
# "into prevailing authoring practices, " \
|
9
|
+
# "and special attention has been given to defining clear conformance criteria for user agents in an effort to improve interoperability.</p>",
|
7
10
|
# "title": "HTML5",
|
8
11
|
# "shortname": "html5",
|
9
12
|
# "series-version": "5",
|
@@ -42,13 +45,18 @@ module W3cApi
|
|
42
45
|
attribute :editor_draft, :string
|
43
46
|
attribute :series_version, :string
|
44
47
|
|
45
|
-
hal_link :self, key:
|
46
|
-
hal_link :version_history, key:
|
47
|
-
|
48
|
-
hal_link :
|
49
|
-
|
50
|
-
hal_link :
|
51
|
-
|
48
|
+
hal_link :self, key: "self", realize_class: "Specification"
|
49
|
+
hal_link :version_history, key: "version-history",
|
50
|
+
realize_class: "SpecVersionIndex"
|
51
|
+
hal_link :first_version, key: "first-version",
|
52
|
+
realize_class: "SpecVersion"
|
53
|
+
hal_link :latest_version, key: "latest-version",
|
54
|
+
realize_class: "SpecVersion"
|
55
|
+
hal_link :supersedes, key: "supersedes",
|
56
|
+
realize_class: "SpecificationIndex", collection: true
|
57
|
+
hal_link :series, key: "series", realize_class: "Serie"
|
58
|
+
hal_link :spec_versions, key: "version-history",
|
59
|
+
realize_class: "SpecVersionIndex"
|
52
60
|
|
53
61
|
key_value do
|
54
62
|
%i[
|
@@ -60,7 +68,7 @@ module W3cApi
|
|
60
68
|
editor_draft
|
61
69
|
series_version
|
62
70
|
].each do |key|
|
63
|
-
map key.to_s.tr(
|
71
|
+
map key.to_s.tr("_", "-"), to: key
|
64
72
|
end
|
65
73
|
end
|
66
74
|
|
@@ -1,12 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "specification"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
# SpecificationIndex class that models `/specifications`
|
8
8
|
class SpecificationIndex < Lutaml::Hal::Page
|
9
|
-
hal_link :specifications, key:
|
9
|
+
hal_link :specifications, key: "specifications",
|
10
|
+
realize_class: "Specification", collection: true
|
10
11
|
end
|
11
12
|
end
|
12
13
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "user"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
class TeamContactIndex < Lutaml::Hal::Page
|
8
|
-
hal_link :team_contacts, key:
|
8
|
+
hal_link :team_contacts, key: "team-contacts", realize_class: "User",
|
9
|
+
collection: true
|
9
10
|
end
|
10
11
|
end
|
11
12
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "lutaml/hal"
|
4
4
|
|
5
5
|
# "testimonials": {
|
6
6
|
# "en": "Google's mission is to organize the world’s information and make it universally accessible and useful."
|
@@ -12,7 +12,7 @@ module W3cApi
|
|
12
12
|
attribute :en, :string
|
13
13
|
|
14
14
|
key_value do
|
15
|
-
map
|
15
|
+
map "en", to: :en
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
4
|
-
require_relative
|
3
|
+
require_relative "call_for_translation"
|
4
|
+
require_relative "user"
|
5
5
|
|
6
6
|
# {
|
7
7
|
# "states"=>[
|
@@ -98,7 +98,7 @@ module W3cApi
|
|
98
98
|
attribute :states, :string, collection: true
|
99
99
|
attribute :translators, User, collection: true
|
100
100
|
|
101
|
-
hal_link :self, key:
|
101
|
+
hal_link :self, key: "self", realize_class: "Translation"
|
102
102
|
|
103
103
|
key_value do
|
104
104
|
%i[
|
@@ -115,7 +115,7 @@ module W3cApi
|
|
115
115
|
states
|
116
116
|
translators
|
117
117
|
].each do |key|
|
118
|
-
map key.to_s.tr(
|
118
|
+
map key.to_s.tr("_", "-"), to: key
|
119
119
|
end
|
120
120
|
end
|
121
121
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "translation"
|
4
4
|
|
5
5
|
# {
|
6
6
|
# "page"=>1,
|
@@ -28,7 +28,8 @@ require_relative 'translation'
|
|
28
28
|
module W3cApi
|
29
29
|
module Models
|
30
30
|
class TranslationIndex < Lutaml::Hal::Page
|
31
|
-
hal_link :translations, key:
|
31
|
+
hal_link :translations, key: "translations",
|
32
|
+
realize_class: "Translation", collection: true
|
32
33
|
end
|
33
34
|
end
|
34
35
|
end
|