ez_attributes 0.2.1 → 0.2.2
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 +2 -0
- data/CHANGELOG.md +8 -1
- data/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/lib/ez_attributes.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55d1858c632570b78182239f11dd266098839e2035ba2279b88981188db1bf09
|
4
|
+
data.tar.gz: 419e205ed30e874089e91910bc5478a592007864742a7852a0355347026efed9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24d2131f2609b1246ec5ca12fca605f9d37e0c73159882842e164549226f90440e8c0138fb767b943d9ed8f865a5eaf64a77714675a7ecdd622dcbb55a521f0e
|
7
|
+
data.tar.gz: bc9779ed2588b57a8655003f888ebf3f055900afb719f395b578a7fa658423397a83213bac742142f0513c87358d22cd5752fbf287dd1308eff4b7c844d81e1f
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
11
11
|
<!-- ### Changed -->
|
12
12
|
<!-- ### Removed -->
|
13
13
|
|
14
|
+
## [0.2.2] - 2021-04-30
|
15
|
+
|
16
|
+
### Changed
|
17
|
+
|
18
|
+
- Fix shared state between class instances. (Commit 759abc7cb971e6a30448f5e9557be4542128d7cf)
|
19
|
+
|
14
20
|
## [0.2.1] - 2021-01-20
|
15
21
|
|
16
22
|
### Changed
|
@@ -39,7 +45,8 @@ end
|
|
39
45
|
|
40
46
|
- Basic module to define class initializers with keyword args.
|
41
47
|
|
42
|
-
[unreleased]: https://github.com/MatheusRich/ez_attributes/compare/v0.2.
|
48
|
+
[unreleased]: https://github.com/MatheusRich/ez_attributes/compare/v0.2.2...HEAD
|
49
|
+
[0.2.2]: https://github.com/MatheusRich/ez_attributes/releases/tag/v0.2.2
|
43
50
|
[0.2.1]: https://github.com/MatheusRich/ez_attributes/releases/tag/v0.2.1
|
44
51
|
[0.2.0]: https://github.com/MatheusRich/ez_attributes/releases/tag/v0.2.0
|
45
52
|
[0.1.0]: https://github.com/MatheusRich/ez_attributes/releases/tag/v0.2.0
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -50,11 +50,11 @@ class User
|
|
50
50
|
attributes :name, :age, email: 'guest@user.com'
|
51
51
|
end
|
52
52
|
|
53
|
-
User.new(name: 'Matz', age: 22)
|
53
|
+
user = User.new(name: 'Matz', age: 22)
|
54
54
|
# => #<User:0x000055bac152f130 @name="Matz", @age=22, @email="guest@user.com">
|
55
55
|
|
56
56
|
# EzAttributes will add getters for all fields too.
|
57
|
-
|
57
|
+
user.name
|
58
58
|
# => "Matz"
|
59
59
|
```
|
60
60
|
|
data/lib/ez_attributes.rb
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
# => #<User:0x000055bac152f130 @name="Matheus", @age=22, @email="guest@user.com">
|
16
16
|
module EzAttributes
|
17
17
|
# Gem version
|
18
|
-
VERSION = '0.2.
|
18
|
+
VERSION = '0.2.2'
|
19
19
|
|
20
20
|
# Attributes that won't have a getter to prevent conflicts with default methods
|
21
21
|
EXCEPTIONS = [:class].freeze
|
@@ -26,7 +26,7 @@ module EzAttributes
|
|
26
26
|
optional_args = args_with_default.map { |name, _| "#{name}: __args_with_default[:#{name}]" }
|
27
27
|
init_args = (required_args + optional_args).join(', ')
|
28
28
|
|
29
|
-
define_method('__args_with_default', -> { args_with_default
|
29
|
+
define_method('__args_with_default', -> { Marshal.load(Marshal.dump(args_with_default)) })
|
30
30
|
private :__args_with_default
|
31
31
|
|
32
32
|
all_args = args + args_with_default.keys
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ez_attributes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matheus Richard
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Easily define initializers with keyword args. It supports required and
|
14
14
|
optional args.
|