Class: W3cApi::Client
- Inherits:
-
Object
- Object
- W3cApi::Client
- Defined in:
- lib/w3c_api/client.rb
Class Method Summary collapse
-
.embed_supported_endpoints ⇒ Object
Class method to list endpoints that support embed parameter.
Instance Method Summary collapse
- #affiliation(id, options = {}) ⇒ Object
-
#affiliations(options = {}) ⇒ Object
Affiliation methods.
- #ecosystem(shortname, options = {}) ⇒ Object
-
#ecosystems(options = {}) ⇒ Object
Ecosystem methods.
-
#embed_supported?(endpoint_id) ⇒ Boolean
Instance method to check if a specific endpoint supports embed.
- #group(id, options = {}) ⇒ Object
-
#groups(options = {}) ⇒ Object
Group methods.
-
#participation(id, options = {}) ⇒ Object
Participation methods.
- #participation_participants(id, options = {}) ⇒ Object
-
#series(options = {}) ⇒ Object
Series methods.
- #series_by_shortname(shortname, options = {}) ⇒ Object
- #series_current_specification(shortname, options = {}) ⇒ Object
- #series_specifications(shortname, options = {}) ⇒ Object
- #specification(shortname, options = {}) ⇒ Object
- #specification_version(shortname, version, options = {}) ⇒ Object
- #specification_version_deliverers(shortname, version, options = {}) ⇒ Object
- #specification_version_editors(shortname, version, options = {}) ⇒ Object
- #specification_versions(shortname, options = {}) ⇒ Object
-
#specifications(options = {}) ⇒ Object
Specification methods.
- #specifications_by_status(status, options = {}) ⇒ Object
- #translation(id, options = {}) ⇒ Object
-
#translations(options = {}) ⇒ Object
Translation methods.
-
#user(hash, options = {}) ⇒ Object
User methods.
Class Method Details
.embed_supported_endpoints ⇒ Object
Class method to list endpoints that support embed parameter
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/w3c_api/client.rb', line 11 def self. hal_instance = W3cApi::Hal.instance = [] hal_instance.register.models.each do |endpoint_id, endpoint_config| # Check if this endpoint has embed parameter support = endpoint_config[:parameters].any? do |param| param.name == "embed" && param.location == :query end << endpoint_id if end .sort end |
Instance Method Details
#affiliation(id, options = {}) ⇒ Object
137 138 139 |
# File 'lib/w3c_api/client.rb', line 137 def affiliation(id, = {}) fetch_resource(:affiliation_resource, id: id, **) end |
#affiliations(options = {}) ⇒ Object
Affiliation methods
133 134 135 |
# File 'lib/w3c_api/client.rb', line 133 def affiliations( = {}) fetch_resource(:affiliation_index, **) end |
#ecosystem(shortname, options = {}) ⇒ Object
152 153 154 |
# File 'lib/w3c_api/client.rb', line 152 def ecosystem(shortname, = {}) fetch_resource(:ecosystem_resource, shortname: shortname, **) end |
#ecosystems(options = {}) ⇒ Object
Ecosystem methods
148 149 150 |
# File 'lib/w3c_api/client.rb', line 148 def ecosystems( = {}) fetch_resource(:ecosystem_index, **) end |
#embed_supported?(endpoint_id) ⇒ Boolean
Instance method to check if a specific endpoint supports embed
28 29 30 |
# File 'lib/w3c_api/client.rb', line 28 def (endpoint_id) self.class..include?(endpoint_id) end |
#group(id, options = {}) ⇒ Object
100 101 102 |
# File 'lib/w3c_api/client.rb', line 100 def group(id, = {}) fetch_resource(:group_resource, id: id, **) end |
#groups(options = {}) ⇒ Object
Group methods
96 97 98 |
# File 'lib/w3c_api/client.rb', line 96 def groups( = {}) fetch_resource(:group_index, **) end |
#participation(id, options = {}) ⇒ Object
Participation methods
164 165 166 |
# File 'lib/w3c_api/client.rb', line 164 def participation(id, = {}) fetch_resource(:participation_resource, id: id, **) end |
#participation_participants(id, options = {}) ⇒ Object
168 169 170 |
# File 'lib/w3c_api/client.rb', line 168 def participation_participants(id, = {}) fetch_resource(:participation_participants_index, id: id, **) end |
#series(options = {}) ⇒ Object
Series methods
77 78 79 |
# File 'lib/w3c_api/client.rb', line 77 def series( = {}) fetch_resource(:serie_index, **) end |
#series_by_shortname(shortname, options = {}) ⇒ Object
81 82 83 |
# File 'lib/w3c_api/client.rb', line 81 def series_by_shortname(shortname, = {}) fetch_resource(:serie_resource, shortname: shortname, **) end |
#series_current_specification(shortname, options = {}) ⇒ Object
90 91 92 93 |
# File 'lib/w3c_api/client.rb', line 90 def series_current_specification(shortname, = {}) fetch_resource(:serie_current_specification_resource, shortname: shortname, **) end |
#series_specifications(shortname, options = {}) ⇒ Object
85 86 87 88 |
# File 'lib/w3c_api/client.rb', line 85 def series_specifications(shortname, = {}) fetch_resource(:serie_specification_resource, shortname: shortname, **) end |
#specification(shortname, options = {}) ⇒ Object
37 38 39 |
# File 'lib/w3c_api/client.rb', line 37 def specification(shortname, = {}) fetch_resource(:specification_resource, shortname: shortname, **) end |
#specification_version(shortname, version, options = {}) ⇒ Object
46 47 48 49 50 51 52 53 |
# File 'lib/w3c_api/client.rb', line 46 def specification_version(shortname, version, = {}) fetch_resource( :specification_resource_version_resource, shortname: shortname, version: version, **, ) end |
#specification_version_deliverers(shortname, version, options = {}) ⇒ Object
71 72 73 74 |
# File 'lib/w3c_api/client.rb', line 71 def specification_version_deliverers(shortname, version, = {}) fetch_resource(:specification_version_deliverers_index, shortname: shortname, version: version, **) end |
#specification_version_editors(shortname, version, options = {}) ⇒ Object
66 67 68 69 |
# File 'lib/w3c_api/client.rb', line 66 def specification_version_editors(shortname, version, = {}) fetch_resource(:specification_version_editors_index, shortname: shortname, version: version, **) end |
#specification_versions(shortname, options = {}) ⇒ Object
41 42 43 44 |
# File 'lib/w3c_api/client.rb', line 41 def specification_versions(shortname, = {}) fetch_resource(:specification_resource_version_index, shortname: shortname, **) end |
#specifications(options = {}) ⇒ Object
Specification methods
33 34 35 |
# File 'lib/w3c_api/client.rb', line 33 def specifications( = {}) fetch_resource(:specification_index, **( || {})) end |
#specifications_by_status(status, options = {}) ⇒ Object
55 56 57 |
# File 'lib/w3c_api/client.rb', line 55 def specifications_by_status(status, = {}) fetch_resource(:specification_by_status_index, status: status, **) end |
#translation(id, options = {}) ⇒ Object
128 129 130 |
# File 'lib/w3c_api/client.rb', line 128 def translation(id, = {}) fetch_resource(:translation_resource, id: id, **) end |
#translations(options = {}) ⇒ Object
Translation methods
124 125 126 |
# File 'lib/w3c_api/client.rb', line 124 def translations( = {}) fetch_resource(:translation_index, **) end |
#user(hash, options = {}) ⇒ Object
User methods
112 113 114 |
# File 'lib/w3c_api/client.rb', line 112 def user(hash, = {}) fetch_resource(:user_resource, hash: hash, **) end |