blood_contracts-ext 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de7cde41f8ed2a4d5af74de5c1229c8d7fbf4c2a4b0f3a42986861fbedc8990a
|
4
|
+
data.tar.gz: 724c7604e77f776b91ecea0755b1665538a7336a1098059649bbf3fde3fd21a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 751cc11b82bfb8c3486f8360541f3663c7bcc7d8a3960f93c59b51b98131c4818ff728f72b738a45745272784bbe1583a223c27ad47c1ac4633ab225fe8a7582
|
7
|
+
data.tar.gz: 15f7dbcd27561aca9f52e7e9bfa80020cdc84204441b580e7612d0176c0e9dba541da6cf20bb9c9e23a9a1df68660f61f827d68f675ee36591f3af598caf4b2d
|
data/blood_contracts-ext.gemspec
CHANGED
@@ -22,7 +22,7 @@ module BloodContracts::Core
|
|
22
22
|
# @private
|
23
23
|
def inherited(child)
|
24
24
|
super
|
25
|
-
child.instance_variable_set(:@extractors, {})
|
25
|
+
child.instance_variable_set(:@extractors, extractors || {})
|
26
26
|
end
|
27
27
|
|
28
28
|
# DSL to define which method to use to extract data from the value
|
@@ -13,12 +13,20 @@ RSpec.describe BloodContracts::Core::MapValue do
|
|
13
13
|
extend Forwardable
|
14
14
|
extract :name
|
15
15
|
extract :phone
|
16
|
+
|
17
|
+
def_delegators :@value, :name, :phone
|
18
|
+
end
|
19
|
+
|
20
|
+
class ContactWithManagerType < ContactType
|
16
21
|
extract :manager_id
|
17
22
|
|
18
|
-
|
23
|
+
def manager_id
|
24
|
+
value.manager_id
|
25
|
+
end
|
19
26
|
end
|
20
27
|
|
21
|
-
ContactJsonType =
|
28
|
+
ContactJsonType =
|
29
|
+
ContactWithManagerType.and_then(BC::MapValue.with(JsonMapper))
|
22
30
|
Contact = Struct.new(:name, :phone, :manager_id)
|
23
31
|
end
|
24
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blood_contracts-ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Dolganov (sclinede)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: blood_contracts-core
|