ree_lib 1.0.113 → 1.0.114
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/ree_lib/packages/ree_dto/package/ree_dto/dto/dto_collection.rb +3 -5
- data/lib/ree_lib/packages/ree_dto/package/ree_dto/functions/build_dto_collection_class.rb +1 -0
- data/lib/ree_lib/packages/ree_dto/spec/ree_dto/dsl_spec.rb +5 -0
- data/lib/ree_lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fa0f66153a455f42150991660c75a1ce836918e054176f4043ad9d825c17a8a
|
4
|
+
data.tar.gz: b1a36ab72f838da9622f96e8e3f9fc8b1946a78608cfdd28a8dae4bf23a4ef52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 278748204360c321e8bd91130bfc675183c4cf6a8fa8324c9383f678b6af1a70e06f11f0f9fc5ccbc34ee90f8c4a7d8caf36ff0240e6bb197de38e50a6742566
|
7
|
+
data.tar.gz: d2123d32021a00f673c5851174dc1c82e646f82db20409c9949842014e4527057e0d8076d8b856c9511a360cbc956d88764360c7e50ae6e6b6560509aab205b6
|
data/Gemfile.lock
CHANGED
@@ -2,6 +2,9 @@ require_relative "./collection_filter"
|
|
2
2
|
|
3
3
|
class ReeDto::DtoCollection
|
4
4
|
include Enumerable
|
5
|
+
extend Forwardable
|
6
|
+
|
7
|
+
def_delegators *([:@list] + Array.public_instance_methods - Object.public_instance_methods)
|
5
8
|
|
6
9
|
LoadError = Class.new(ArgumentError)
|
7
10
|
|
@@ -20,11 +23,6 @@ class ReeDto::DtoCollection
|
|
20
23
|
@list.each(&block)
|
21
24
|
end
|
22
25
|
|
23
|
-
contract None => Integer
|
24
|
-
def size
|
25
|
-
@list.size
|
26
|
-
end
|
27
|
-
|
28
26
|
class << self
|
29
27
|
def filter(name, filter_proc)
|
30
28
|
define_method name do
|
@@ -91,11 +91,16 @@ RSpec.describe ReeDto::DSL do
|
|
91
91
|
dto.numbers << 1
|
92
92
|
dto.numbers << 2
|
93
93
|
|
94
|
+
expect(dto.numbers.first).to eq(1)
|
95
|
+
expect(dto.numbers.last).to eq(2)
|
96
|
+
expect(dto.numbers.find { _1 == 1 }).to eq(1)
|
94
97
|
expect(dto.numbers.class).to eq(ReeDto::DtoClass::NumbersCollectionDto)
|
95
98
|
expect(dto.users.class).to eq(ReeDto::DtoClass::UsersCollectionDto)
|
96
99
|
expect(dto.active_users.class).to eq(ReeDto::DtoClass::ActiveUsersCollectionDto)
|
97
100
|
expect(dto.numbers.sum).to eq(3)
|
98
101
|
expect(dto.numbers.to_s).to eq("odd_collection")
|
102
|
+
dto.numbers.clear
|
103
|
+
expect(dto.numbers.size).to eq(0)
|
99
104
|
}
|
100
105
|
|
101
106
|
it {
|
data/lib/ree_lib/version.rb
CHANGED