HornsAndHooves-flat_map 0.6.0 → 0.7.0

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: 4db8b5781fc2f7f28c54c20e3700d40c9b10f32e6cdb19d37a208a3bfc717f7a
4
- data.tar.gz: e8af14f2b65a782da9c337f6121902b66bcf26e2168d6a4cfc3bacbc8a300323
3
+ metadata.gz: fd4f2b02c245613b8d3f3346d2355ae2108a4342ddb9f9cd1e268ef87310f1b8
4
+ data.tar.gz: fdf3bf9c4a4ffaa3c6647d907d0e02846eabbc60f5d9b593555d1904f371e72d
5
5
  SHA512:
6
- metadata.gz: 3467cd650843ef17dac92e7ae48ddfcae67fee7ce459cfe11f86fc814f09f1d325e1173c1c38aea454cfdfafc0dde3b4336013d827b31ed3cfd50bf06c5e87a9
7
- data.tar.gz: 027eeff4f646833fcafd9efeefa0efee4c11b9b93d523a82d407c6ca905d920f497f0283fe69282cfe8d372fd3255655b8d5d5208a37b729c4afa29c63886afd
6
+ metadata.gz: ded272e0095638c4173d099651186dedd3116e1ac4532c0473d7dd6f126227026b55c6346728630fffe2580f483b5c0521c982a8bb0231eecc0917d498fa56e5
7
+ data.tar.gz: 20037626c6382fd471dff4db1a41f7ec09f81e7a5bbbe0ff80ffa6b1990bda10a1992dbf989da33e77ad1c0da7e0a9767bfff69a8ade32dfaf0abb08b9bda2e5
@@ -49,7 +49,7 @@ module FlatMap
49
49
  end
50
50
 
51
51
  # Overridden to add suffixing support for mappings of mappers with name suffix
52
- def add(attr, *args)
52
+ def add(attr, type, **options)
53
53
  attr = :"#{attr}_#{@base.suffix}" if attr != :base && @base.suffixed?
54
54
  super
55
55
  end
@@ -55,13 +55,13 @@ module FlatMap
55
55
  # @param [Object] target Target of mapping
56
56
  # @param [*Symbol] traits List of traits
57
57
  # @raise [FlatMap::Mapper::NoTargetError]
58
- def initialize(target, *traits)
58
+ def initialize(target, *traits, &block)
59
59
  raise NoTargetError.new(self.class) unless target
60
60
 
61
61
  @target, @traits = target, traits
62
62
 
63
63
  if block_given?
64
- singleton_class.trait :extension, &Proc.new
64
+ singleton_class.trait :extension, &block
65
65
  end
66
66
  end
67
67
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module FlatMap # :nodoc:
2
- VERSION = "0.6.0" # :nodoc:
4
+ VERSION = "0.7.0" # :nodoc:
3
5
  end
@@ -35,10 +35,10 @@ module FlatMap
35
35
  with({:attr_a => :attr_a, :mapped_attr_b => :attr_b}, {:writer => false}).
36
36
  and_call_original
37
37
  expect(Mapping::Factory).to receive(:new).
38
- with(:attr_a, :attr_a, :writer => false).
38
+ with(:attr_a, :attr_a, { :writer => false }).
39
39
  and_call_original
40
40
  expect(Mapping::Factory).to receive(:new).
41
- with(:mapped_attr_b, :attr_b, :writer => false).
41
+ with(:mapped_attr_b, :attr_b, { :writer => false }).
42
42
  and_call_original
43
43
 
44
44
  MappingSpec::EmptyMapper.class_eval do
@@ -76,7 +76,7 @@ module FlatMap
76
76
  context 'defining mountings' do
77
77
  it "should use Factory for defining mappings" do
78
78
  expect(Mapper::Factory).to receive(:new).
79
- with(:foo, :mapper_class_name => 'FooMapper').
79
+ with(:foo, { :mapper_class_name => 'FooMapper' }).
80
80
  and_call_original
81
81
 
82
82
  expect{ MountingSpec::EmptyMapper.mount(:foo, :mapper_class_name => 'FooMapper') }.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: HornsAndHooves-flat_map
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - HornsAndHooves
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2022-05-27 00:00:00.000000000 Z
15
+ date: 2024-01-09 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activesupport
@@ -207,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
209
  requirements: []
210
- rubygems_version: 3.0.9
210
+ rubygems_version: 3.1.6
211
211
  signing_key:
212
212
  specification_version: 4
213
213
  summary: Deep object graph to a plain properties mapper