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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb77d3a2632671effd8c80d733e53f779a7761c085fbccb68dfc52249c7e98ea
4
- data.tar.gz: 19c54d8117bf8f3dc5e9a6374aa80af299270c3d0e3ff85f3951ead216308f24
3
+ metadata.gz: 3fa0f66153a455f42150991660c75a1ce836918e054176f4043ad9d825c17a8a
4
+ data.tar.gz: b1a36ab72f838da9622f96e8e3f9fc8b1946a78608cfdd28a8dae4bf23a4ef52
5
5
  SHA512:
6
- metadata.gz: cc40d56b11b04ba48d5c3e4cea3de8c0fa1292f75bcd1dce90544542fc92ab26cb77a9774831831fc4c38efd0105d2dbff9407814c4ae495a51bff920f310b81
7
- data.tar.gz: 53a0bf48487d02322766a2a7fac151058dc52678a8d228f20add3161e80c3096e8ec3f5d82b9a6a0d0b88963a90a245b46999e9a62a065260cbda331045d04a6
6
+ metadata.gz: 278748204360c321e8bd91130bfc675183c4cf6a8fa8324c9383f678b6af1a70e06f11f0f9fc5ccbc34ee90f8c4a7d8caf36ff0240e6bb197de38e50a6742566
7
+ data.tar.gz: d2123d32021a00f673c5851174dc1c82e646f82db20409c9949842014e4527057e0d8076d8b856c9511a360cbc956d88764360c7e50ae6e6b6560509aab205b6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ree_lib (1.0.113)
4
+ ree_lib (1.0.114)
5
5
  bigdecimal (~> 3.1.6)
6
6
  binding_of_caller (~> 1.0.0)
7
7
  i18n (~> 1.14.1)
@@ -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
@@ -25,6 +25,7 @@ class ReeDto::BuildDtoCollectionClass
25
25
 
26
26
  alias :<< :add
27
27
  alias :push :add
28
+ alias :remove :delete
28
29
  end
29
30
 
30
31
  const_name = "#{name}CollectionDto"
@@ -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 {
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReeLib
4
- VERSION = "1.0.113"
4
+ VERSION = "1.0.114"
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.113
4
+ version: 1.0.114
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Gatiyatov