statinize 0.2.0 → 0.2.1

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/statinize/statinizer.rb +6 -4
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49d4254b241b024535b320e063744a0ee01cfc45a8ec289265c89b3af65cc729
4
- data.tar.gz: 178add180ff764c00eda41df13b9bf4d52eb51a6d4dd55b7bbc316793ac56dd6
3
+ metadata.gz: 7814eb5a73fe5fb67c846398c6d22573b183cafd88c243175ef4fb39c5f71fbe
4
+ data.tar.gz: b7eec7d141ae6a0deda224802f67dae791ea7b9c96957922c9a7fa9c1b052e6a
5
5
  SHA512:
6
- metadata.gz: 9b3c92ef8e0f345d92d307a30c8a7c60450fd9c9289e10ee88412e8bcee0859334c6be936a3e806eb08add2d270aa577658abd3998db505c962d8670cf19d723
7
- data.tar.gz: 36a54dde0c7c615eb1610e5a0249d43c374eaed76bd8a6a447acd5fffbc62e74294c85a986c788a7c07b43d45aff39cb1629714327ff1f27eccf9ea46d07157a
6
+ metadata.gz: 8bea982ae518d67bb7f9c0a9cab47dd081d869dabbdf01874e14de5c2004217bd6f395e5e040f93499cbe5de413e1d3ed6b59222e9d8089cb6b01289748d1be9
7
+ data.tar.gz: '08111b888a705bb74fe044f9de93ebcfd6863646df65510bf62e0566b23af1e4ef410609a22b0fc1afb1b15ffac62edbd9b43264a02191504e25296a99eab1e8'
@@ -8,7 +8,7 @@ module Statinize
8
8
  end
9
9
 
10
10
  def attribute(*attrs, **options)
11
- options.merge!(@validate_with) if @validate_with
11
+ options.merge!(@with) if @with
12
12
 
13
13
  attrs.each do |attr|
14
14
  Attribute.create(klass, attr, options)
@@ -16,17 +16,19 @@ module Statinize
16
16
  end
17
17
 
18
18
  def validate(*attrs, **options)
19
+ options.merge!(@with) if @with
20
+
19
21
  attrs.each do |attr|
20
22
  attribute = attributes.find { _1.name == attr }
21
23
  attribute&.add_options(options)
22
24
  end
23
25
  end
24
26
 
25
- def validate_with(**kwargs, &block)
26
- @validate_with = kwargs
27
+ def with(**kwargs, &block)
28
+ @with = kwargs
27
29
  instance_exec(&block)
28
30
 
29
- remove_instance_variable(:@validate_with) if @validate_with
31
+ remove_instance_variable(:@with) if @with
30
32
  end
31
33
 
32
34
  def force(force = nil)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statinize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Barseek