mutils 1.1.8 → 1.2.0

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: 94d6da4644276d7dedd0ec72bed60522932d441b36d9cb39f06c15e64043e5d7
4
- data.tar.gz: d74e61d2264be3fcb8adc4a1d332ac761a9bb33c52043f4873cecc9edca79166
3
+ metadata.gz: ee4bcc8d29af2074d7f171e424c90b27a1214813ccdec6a97f5696f1e7bb9e90
4
+ data.tar.gz: bfd86ae9c1f17998804f8904706e0acbb0af72a05d5f9a8c9c3123cf1da777e2
5
5
  SHA512:
6
- metadata.gz: cf73bee321590298223a24eb8adc6ffe535a71c5b5430e8be17a9cc1e82185ed7076c22fb83de83ba224e0199b5b70f059d3601480a442a4d66ddb87a9a3aed3
7
- data.tar.gz: 72be6e98d49bb3e9dfb7c36f88da64850c49aa2b74a8ac9060ffdddcd252a7870f1bb7dd450b757fc468b891af2b495eb27aa5463fbe1fedb7a703785d8611ad
6
+ metadata.gz: 7b85fbb8d97f1fa6e751564895c5efe4810038d2884f26fb1d94e6033ec0005da5a82f020a105b4b5636125225f30c35990395e957a64cf305442328aa234458
7
+ data.tar.gz: f601f8d4e1f7351823d5353feb392b19386d7830eb0126a2e45fa6fe5cc81bfd65871b9f0b3c410d392999ded18bb1d20940fadac59f35d79cf0a40129f01819
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [1.2.0](https://github.com/Code-Vedas/mutils/compare/v1.1.8...v1.2.0) (2021-08-20)
2
+
3
+
4
+ ### Features
5
+
6
+ * attribute can accept Proc without params ([c014fef](https://github.com/Code-Vedas/mutils/commit/c014fef841426673d1f409b56a1c2548222fd2f5))
7
+
1
8
  ## [1.1.8](https://github.com/Code-Vedas/mutils/compare/v1.1.7...v1.1.8) (2021-08-20)
2
9
 
3
10
 
data/Gemfile.lock CHANGED
@@ -7,7 +7,7 @@ GIT
7
7
  PATH
8
8
  remote: .
9
9
  specs:
10
- mutils (1.1.7)
10
+ mutils (1.1.8)
11
11
  dry-inflector
12
12
 
13
13
  GEM
@@ -25,7 +25,7 @@ GEM
25
25
  tins (~> 1.6)
26
26
  diff-lcs (1.4.4)
27
27
  docile (1.3.2)
28
- dry-inflector (0.2.0)
28
+ dry-inflector (0.2.1)
29
29
  json (2.5.1)
30
30
  json (2.5.1-java)
31
31
  parallel (1.20.1)
data/README.md CHANGED
@@ -74,6 +74,8 @@ class UserSerializer < Mutils::Serialization::BaseSerializer
74
74
  attributes :id, :first_name, :last_name, :email
75
75
  ## OR
76
76
  attribute :email, {always_include: true} ## this will allow to selectively include email
77
+ ## OR
78
+ attribute :email, &:email ## this will call email attribute from User
77
79
  end
78
80
  ```
79
81
  ### Relations
data/Version CHANGED
@@ -1 +1 @@
1
- v1.1.8
1
+ v1.2.0
@@ -9,7 +9,10 @@ module Mutils
9
9
  module Attributes
10
10
  def fetch_block_attributes(attributes, result_hash)
11
11
  attributes&.each do |key, s_options|
12
- result_hash[key] = s_options[:block].call(scope, options[:params] || {})
12
+ arg = [scope]
13
+ arg << options[:params] || {} unless s_options[:block].parameters.flatten.include?(:rest)
14
+
15
+ result_hash[key] = s_options[:block].call(*arg)
13
16
  end
14
17
  end
15
18
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mutils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.8
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nitesh Purohit
@@ -114,7 +114,7 @@ licenses:
114
114
  - MIT
115
115
  metadata:
116
116
  bug_tracker_uri: https://github.com/code-vedas/mutils/issues
117
- source_code_uri: https://github.com/code-vedas/mutils/tree/v1.1.8
117
+ source_code_uri: https://github.com/code-vedas/mutils/tree/v1.2.0
118
118
  post_install_message:
119
119
  rdoc_options: []
120
120
  require_paths: