ama-entity-mapper 0.1.0.beta.2 → 0.1.0.beta.3

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
  SHA1:
3
- metadata.gz: 0d0c0cf60104e47b8740fcf39308aed94336b1d8
4
- data.tar.gz: 939f7581b6587ef04c5c8ceddfdf56c81e27343d
3
+ metadata.gz: 3b881d4a0a9459f68f77be0f206f7bc72ef7c965
4
+ data.tar.gz: 66d91f59574ea56685709278557502179429bed2
5
5
  SHA512:
6
- metadata.gz: 54823c3cf8e775b9a9021c4d0606b1423169f5c5608670a11a299e07470cc5b03bc0c318c38364283e235bdf95a93bdbd8d4566644da6c7c472aa33e6b71c75f
7
- data.tar.gz: 11fe5500ee4d7b69f0146a33c544ef49bdf2b8ad8bdc888504d04420afa6636bbf6c2c55cbcddb8c79c626606c223bbda35eb7c29565e758d6ff06455ba58a61
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] _context
20
- def normalize(entity, type, _context = nil)
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 || attribute.sensitive
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
@@ -8,7 +8,7 @@ module AMA
8
8
  MINOR = 1
9
9
  PATCH = 0
10
10
  CLASSIFIER = 'beta'.freeze
11
- PRERELEASE_NUMBER = 2
11
+ PRERELEASE_NUMBER = 3
12
12
  CHUNKS = [MAJOR, MINOR, PATCH, CLASSIFIER, PRERELEASE_NUMBER].freeze
13
13
  VERSION = CHUNKS.reject(&:nil?).join('.').freeze
14
14
  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.2
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-05 00:00:00.000000000 Z
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.12
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