koine-attributes 1.2.0 → 1.2.1

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: 177452f3f12545dbcaf9a2b57043de1f2efb0d93
4
- data.tar.gz: 52749eb82a9d367a7b2a2a12298fa1cc6c072770
3
+ metadata.gz: 31a8d2d76c9047ec3640b022dbb35327732c2768
4
+ data.tar.gz: 79a6cb3bce2bd1f866d3e900bd7ba3c9cf930ad6
5
5
  SHA512:
6
- metadata.gz: 94d847fb964cbed0f0c6889c8737e133a4cc9c369dafc4d4b2403634998afff288c8ea648855ab79f53f388139248a45344c7b9d3d35d3d5697a9466caa6dabd
7
- data.tar.gz: 1d88d2820b0b64408e4c53fd1da2310afd84c32b692c8a2ad0f95ec5d2aa63426c78e40119fd90d241e1452736dbb1f1538e1305126cf65328fb6d474724ced2
6
+ metadata.gz: 5ad0a70022e718798db7ec952c0118a2a2a87d354ec42b7af0738ea8c639cf9349524e50835c2cb0b4892b23e284576774b5ec051b5e987b8cc985ace5cac91e
7
+ data.tar.gz: 62c5e0b678f2483d01ece0d20754e54db195fec8c2c0940ca72d31fa0ce248f32f470f216ab7bfabfb9d76091c4b1144e795ddcdd05d4940203c2eb426b9fd8d
@@ -11,6 +11,11 @@ module Koine
11
11
  @adapter
12
12
  end
13
13
 
14
+ def with_attribute_name(name)
15
+ @adapter.with_attribute_name(name)
16
+ super(name)
17
+ end
18
+
14
19
  private
15
20
 
16
21
  def coerce_not_nil(collectionOfValues)
@@ -2,10 +2,10 @@ module Koine
2
2
  module Attributes
3
3
  module Adapter
4
4
  class Base
5
- attr_accessor :attribute_name
5
+ attr_reader :attribute_name
6
6
 
7
7
  def initialize
8
- @attribute_name = 'annonymous_attribute_name'
8
+ with_attribute_name('annonymous_attribute_name')
9
9
  end
10
10
 
11
11
  def coerce(value)
@@ -33,6 +33,11 @@ module Koine
33
33
  self
34
34
  end
35
35
 
36
+ def with_attribute_name(name)
37
+ @attribute_name = name
38
+ self
39
+ end
40
+
36
41
  private
37
42
 
38
43
  def coerce_nil
@@ -16,6 +16,12 @@ module Koine
16
16
  @value_adapter
17
17
  end
18
18
 
19
+ def with_attribute_name(name)
20
+ @key_adapter.with_attribute_name(name)
21
+ @value_adapter.with_attribute_name(name)
22
+ super(name)
23
+ end
24
+
19
25
  private
20
26
 
21
27
  def coerce_not_nil(hash)
@@ -12,7 +12,7 @@ module Koine
12
12
 
13
13
  def add_attribute(name, adapter, &block)
14
14
  adapter = coerce_adapter(adapter)
15
- adapter.attribute_name = name
15
+ adapter.with_attribute_name(name)
16
16
  yield(adapter) if block
17
17
  @adapters[name.to_sym] = adapter.freeze
18
18
  end
@@ -1,5 +1,5 @@
1
1
  module Koine
2
2
  module Attributes
3
- VERSION = '1.2.0'.freeze
3
+ VERSION = '1.2.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: koine-attributes
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcelo Jacobus
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-02 00:00:00.000000000 Z
11
+ date: 2018-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler