parametric 0.2.13 → 0.2.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/parametric/struct.rb +4 -0
- data/lib/parametric/version.rb +1 -1
- data/spec/struct_spec.rb +4 -0
- 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: 40164472fa5f68d604b2f20b6823b4b7c0ca81136c46826705d3a3a4b2e903f2
|
4
|
+
data.tar.gz: 1bce90d98794e1cc1a169bea9ff0b6d606486a9a2e33b95b0e461cfaae567c63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b93f931277e786ea4f6a39d2db2a8152be14a9887c4a31bfb54a38c5127c85bf43b6e35e442b4b9cc40531879d5638ed234b4e62102cffb23c5b2bf12552c6e
|
7
|
+
data.tar.gz: ca54de8f1cc1aaf4b0cb4805197e634ab07ecabf31cab56a54e3fca330312c3b247a984d5efabef9350729008e1f319730a74b1b068f6685eb6f9c74ddda71aa
|
data/lib/parametric/struct.rb
CHANGED
data/lib/parametric/version.rb
CHANGED
data/spec/struct_spec.rb
CHANGED
@@ -40,6 +40,10 @@ describe Parametric::Struct do
|
|
40
40
|
expect(instance.friends.first.name).to eq 'Ismael'
|
41
41
|
expect(instance.friends.first).to be_a friend_class
|
42
42
|
|
43
|
+
# Hash access with #[]
|
44
|
+
expect(instance[:title]).to eq instance.title
|
45
|
+
expect(instance[:friends].first[:name]).to eq instance.friends.first.name
|
46
|
+
|
43
47
|
invalid_instance = klass.new({
|
44
48
|
friends: [
|
45
49
|
{name: 'Ismael', age: 40},
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parametric
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ismael Celis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|