ama-entity-mapper 0.1.0.beta.2 → 0.1.0.beta.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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3b881d4a0a9459f68f77be0f206f7bc72ef7c965
|
|
4
|
+
data.tar.gz: 66d91f59574ea56685709278557502179429bed2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6d3120f43261ce3a228484af8c6ca0e7b94db271816f76b42e67adb49b61679a1bcf6d40bf028b05b1daf95d16dfbb92282e2d9bf5f7e466c8c1741ddeeb820c
|
|
7
|
+
data.tar.gz: 5e19ec66630451588038aaaea4510ff7e597b9b6257729df1b68036bf9a40d7ca787870623dfeee356f9cdb92aa1571240c15e4bc65260a8d7e4778ceaa9a4f3
|
|
@@ -23,6 +23,9 @@ module AMA
|
|
|
23
23
|
# @!attribute [r] strict
|
|
24
24
|
# @return [FalseClass, TrueClass]
|
|
25
25
|
attr_reader :strict
|
|
26
|
+
# @!attribute [r] include_sensitive_attributes
|
|
27
|
+
# @return [FalseClass, TrueClass]
|
|
28
|
+
attr_reader :include_sensitive_attributes
|
|
26
29
|
|
|
27
30
|
def initialize(**options)
|
|
28
31
|
defaults = respond_to?(:defaults) ? self.defaults : {}
|
|
@@ -38,7 +41,9 @@ module AMA
|
|
|
38
41
|
{
|
|
39
42
|
path: Path.new,
|
|
40
43
|
logger: Logger.new(Aux::NullStream::INSTANCE),
|
|
41
|
-
strict: true
|
|
44
|
+
strict: true,
|
|
45
|
+
# Unstable feature, most likely it's name will change
|
|
46
|
+
include_sensitive_attributes: false
|
|
42
47
|
}
|
|
43
48
|
end
|
|
44
49
|
|
|
@@ -16,10 +16,12 @@ module AMA
|
|
|
16
16
|
|
|
17
17
|
# @param [Object] entity
|
|
18
18
|
# @param [AMA::Entity::Mapper::Type] type
|
|
19
|
-
# @param [AMA::Entity::Mapper::Context]
|
|
20
|
-
def normalize(entity, type,
|
|
19
|
+
# @param [AMA::Entity::Mapper::Context] context
|
|
20
|
+
def normalize(entity, type, context)
|
|
21
21
|
type.attributes.values.each_with_object({}) do |attribute, data|
|
|
22
|
-
next if attribute.virtual
|
|
22
|
+
next if attribute.virtual
|
|
23
|
+
condition = context.include_sensitive_attributes
|
|
24
|
+
next if attribute.sensitive && !condition
|
|
23
25
|
data[attribute.name] = object_variable(entity, attribute.name)
|
|
24
26
|
end
|
|
25
27
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ama-entity-mapper
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.0.beta.
|
|
4
|
+
version: 0.1.0.beta.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- AMA Team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-08-
|
|
11
|
+
date: 2017-08-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
187
187
|
version: 1.3.1
|
|
188
188
|
requirements: []
|
|
189
189
|
rubyforge_project:
|
|
190
|
-
rubygems_version: 2.6.
|
|
190
|
+
rubygems_version: 2.6.11
|
|
191
191
|
signing_key:
|
|
192
192
|
specification_version: 4
|
|
193
193
|
summary: Converts and instantiates classes from native data structures
|