lutaml-hal 0.1.7 → 0.1.8
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/README.adoc +115 -1145
- data/lib/lutaml/hal/client.rb +24 -0
- data/lib/lutaml/hal/endpoint_configuration.rb +50 -0
- data/lib/lutaml/hal/endpoint_parameter.rb +188 -0
- data/lib/lutaml/hal/global_register.rb +4 -0
- data/lib/lutaml/hal/link.rb +56 -1
- data/lib/lutaml/hal/model_register.rb +170 -63
- data/lib/lutaml/hal/resource.rb +22 -0
- data/lib/lutaml/hal/version.rb +1 -1
- data/lib/lutaml/hal.rb +1 -0
- metadata +4 -2
data/lib/lutaml/hal/resource.rb
CHANGED
@@ -13,6 +13,28 @@ module Lutaml
|
|
13
13
|
# will be used to resolve links unless overriden in resource#realize()
|
14
14
|
attr_accessor Hal::REGISTER_ID_ATTR_NAME.to_sym
|
15
15
|
|
16
|
+
# Access embedded data if available
|
17
|
+
def embedded_data
|
18
|
+
@_embedded
|
19
|
+
end
|
20
|
+
|
21
|
+
# Check if embedded data exists for a given key
|
22
|
+
def has_embedded?(key)
|
23
|
+
embedded_data&.key?(key.to_s)
|
24
|
+
end
|
25
|
+
|
26
|
+
# Get embedded content for a specific key
|
27
|
+
def get_embedded(key)
|
28
|
+
embedded_data&.[](key.to_s)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Create a resource instance from embedded JSON data
|
32
|
+
def self.from_embedded(json_data, register_name = nil)
|
33
|
+
instance = from_json(json_data.to_json)
|
34
|
+
instance.instance_variable_set("@#{Hal::REGISTER_ID_ATTR_NAME}", register_name) if register_name
|
35
|
+
instance
|
36
|
+
end
|
37
|
+
|
16
38
|
class << self
|
17
39
|
attr_accessor :link_definitions
|
18
40
|
|
data/lib/lutaml/hal/version.rb
CHANGED
data/lib/lutaml/hal.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lutaml-hal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-07-
|
11
|
+
date: 2025-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -79,6 +79,8 @@ files:
|
|
79
79
|
- lib/lutaml-hal.rb
|
80
80
|
- lib/lutaml/hal.rb
|
81
81
|
- lib/lutaml/hal/client.rb
|
82
|
+
- lib/lutaml/hal/endpoint_configuration.rb
|
83
|
+
- lib/lutaml/hal/endpoint_parameter.rb
|
82
84
|
- lib/lutaml/hal/errors.rb
|
83
85
|
- lib/lutaml/hal/global_register.rb
|
84
86
|
- lib/lutaml/hal/link.rb
|