shale-builder 0.6.2 → 0.6.3
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/CHANGELOG.md +7 -0
- data/Gemfile.lock +1 -1
- data/lib/shale/builder/assigned_attributes.rb +19 -12
- data/lib/shale/builder/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8390e896860a9ae2aedb9e0c27166f2988a680f03dc78cfd30d0b58154ffd32f
|
|
4
|
+
data.tar.gz: a911f2ccd9ea7d8b233420135d0c27d65ec721c169d7cde490ffd59fcb42f7e7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4c102d77a38b6d1331bf5b5087cf812adf1c16f2aa3a092f9c1ada4b342a85925ea21eebed95156a6e586cd2cbbbe240c0cbe6c6d858f9e266bd26a99db2e9fc
|
|
7
|
+
data.tar.gz: 70b49b02528f27f284106e9ce12df12aa12e3f76940e8aa93fa37af7cf3f1dd0d4c434c7583d3e727109188ece728b7a91a3e7deebf41979fc1b9fda3ed7fc93
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.6.3] - 2025-10-16
|
|
9
|
+
|
|
10
|
+
[Diff](https://github.com/Verseth/ruby-shale-builder/compare/v0.6.2...v0.6.3)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
- Improve `Shale::Builder::AssignedAttributes` to handle assignment in methods like `from_hash`
|
|
14
|
+
|
|
8
15
|
## [0.6.2] - 2025-10-16
|
|
9
16
|
|
|
10
17
|
[Diff](https://github.com/Verseth/ruby-shale-builder/compare/v0.6.0...v0.6.2)
|
data/Gemfile.lock
CHANGED
|
@@ -14,6 +14,8 @@ module Shale
|
|
|
14
14
|
extend T::Sig
|
|
15
15
|
extend T::Helpers
|
|
16
16
|
|
|
17
|
+
DEFAULT = Object.new
|
|
18
|
+
|
|
17
19
|
class << self
|
|
18
20
|
extend T::Sig
|
|
19
21
|
|
|
@@ -43,14 +45,27 @@ module Shale
|
|
|
43
45
|
#: Module
|
|
44
46
|
attr_reader :assigned_attributes_methods_module
|
|
45
47
|
|
|
46
|
-
#: (
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
#: (
|
|
49
|
+
#| String | Symbol name,
|
|
50
|
+
#| Class shale_mapper,
|
|
51
|
+
#| ?collection: bool,
|
|
52
|
+
#| ?default: Proc?,
|
|
53
|
+
#| **Object kwargs
|
|
54
|
+
#| ) ?{ -> void } -> void
|
|
55
|
+
def attribute(
|
|
56
|
+
name,
|
|
57
|
+
shale_mapper,
|
|
58
|
+
collection: false,
|
|
59
|
+
default: -> { DEFAULT },
|
|
60
|
+
**kwargs,
|
|
61
|
+
&block
|
|
62
|
+
)
|
|
63
|
+
super(name, shale_mapper, collection:, default:, **kwargs, &block) # rubocop:disable Style/SuperArguments
|
|
49
64
|
|
|
50
65
|
@assigned_attributes_methods_module.class_eval <<~RUBY, __FILE__, __LINE__ + 1
|
|
51
66
|
def #{name}=(val)
|
|
67
|
+
return if val.equal?(::Shale::Builder::AssignedAttributes::DEFAULT)
|
|
52
68
|
super
|
|
53
|
-
return unless @__initialized
|
|
54
69
|
|
|
55
70
|
self.assigned_attribute_names << #{name.to_sym.inspect}
|
|
56
71
|
end
|
|
@@ -59,14 +74,6 @@ module Shale
|
|
|
59
74
|
end
|
|
60
75
|
mixes_in_class_methods ClassMethods
|
|
61
76
|
|
|
62
|
-
def initialize(*args, **kwargs, &block)
|
|
63
|
-
super
|
|
64
|
-
@__initialized = true
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
#: bool?
|
|
68
|
-
attr_reader :__initialized
|
|
69
|
-
|
|
70
77
|
# Returns a set of names of assigned shale attributes.
|
|
71
78
|
#
|
|
72
79
|
#: -> Set[Symbol]
|