ree_lib 1.0.107 → 1.0.109

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: 28f3adfaea70ca8f4acd1b767181790a4b90e0af65449745e0e499f80353f78d
4
- data.tar.gz: feae7ca14b04d4360866547e84773b402d97fc1c0b9546de1f45c2334cc4db99
3
+ metadata.gz: f2c475acec8b61f3686477e9ae4643427b3f956c8abb2ae8fe6c4d8e8ebb2c82
4
+ data.tar.gz: 0a2138c853bd35f2340a9469b960e0c2cad3f89e4fdc4662692661048c9a3638
5
5
  SHA512:
6
- metadata.gz: fd70c16af7f3b3c2f1eaf0c165daee6e5b978e4ea5b36ae7dec584a4a950843555f2a60fe8d0f43b1a6cab7580e749ddf3f76d137404ad78fb7605051cec3ea1
7
- data.tar.gz: ee42df7d56fbf5911644f40e8b8752842568cbaa7e8794280a6fb9f299f9940fedaca22206ffe2790de96ef341c5df8793c6c3a60af306b79ec29f84c85fe346
6
+ metadata.gz: bb6bab53e49f860719f7b342df2500a16f5ce97e431cc2e96d04df39bdc749521a5f639f4d0d6f6b3068ed840e35adaa5144847805b8a5254d12e3969f36c566
7
+ data.tar.gz: 1bb7d488e89e1c5824012f6e1cde805bcc1d5bd095515c0e90608fca7995884115b2053fd6527306c0d6476884601c2d446b445260cabc46229e9e73cc8d11e4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ree_lib (1.0.107)
4
+ ree_lib (1.0.109)
5
5
  bigdecimal (~> 3.1.6)
6
6
  binding_of_caller (~> 1.0.0)
7
7
  i18n (~> 1.14.1)
@@ -4,7 +4,7 @@ class ReeDto::CollectionMeta
4
4
 
5
5
  attr_reader :name, :contract, :filter_proc
6
6
 
7
- contract Symbol, Any, Proc => Any
7
+ contract Symbol, Any, Nilor[Proc] => Any
8
8
  def initialize(name, contract, filter_proc)
9
9
  @name = name
10
10
  @contract = contract
@@ -12,21 +12,11 @@ class ReeDto::DtoCollection
12
12
  @parent_class = parent_class
13
13
  @contract = contract
14
14
  @name = name
15
- @list = nil
16
- end
17
-
18
- contract None => nil
19
- def reset
20
15
  @list = []
21
- nil
22
16
  end
23
17
 
24
18
  contract Optblock => Any
25
19
  def each(&block)
26
- if @list.nil?
27
- raise LoadError.new("collection :#{@name} for #{@parent_class} is not loaded")
28
- end
29
-
30
20
  @list.each(&block)
31
21
  end
32
22
 
@@ -47,7 +47,7 @@ class ReeDto::BuildDto
47
47
 
48
48
  builder.collections.each do |collection|
49
49
  col_class = build_dto_collection_class(collection.contract)
50
- col_class.class_exec(&collection.filter_proc)
50
+ col_class.class_exec(&collection.filter_proc) if collection.filter_proc
51
51
 
52
52
  klass.instance_exec do
53
53
  contract ArrayOf[collection.contract] => DtoCollection
@@ -20,6 +20,8 @@ RSpec.describe ReeDto::DSL do
20
20
  end
21
21
  end
22
22
 
23
+ collection :active_users, User
24
+
23
25
  collection :users, User do
24
26
  filter :active, -> { _1.status == "active" }
25
27
  filter :inactive, -> { _1.status != "active" }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReeLib
4
- VERSION = "1.0.107"
4
+ VERSION = "1.0.109"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ree_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.107
4
+ version: 1.0.109
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Gatiyatov