json_data_extractor 0.0.14 → 0.0.15

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: 2a35a6bf0ed27b3f5a0ef9a13e96ff21ac28ff873772696aef65069821dbf23e
4
- data.tar.gz: 9dba998316601c445cebe5872f04e18c68575196b9ed52e4128f01b47139049a
3
+ metadata.gz: e6c3dff84f5c9b6ce630ff1973dc3e657ebfb93cf96306c9941e63bc9fb4fde5
4
+ data.tar.gz: cb83044ea64e5d560e24d6be3d0e37413eb8302c7987e18131767ad9cdd477d2
5
5
  SHA512:
6
- metadata.gz: 204620707292cb9e1f805db3bbc72b44e6dca7f1dc86dceefa8b9b1126f437fa70bc152af38bb502741d620884f141b46664a6a6c80fb135bc20f394b8d62300
7
- data.tar.gz: '0482bfd00032c8e07c0a97ce88c6bbfba824bc6ea7eb6ec7aecd329c92982afae2853333f096695d68f52f737a01cca253a9f199616a22e565211b60b9d0f6eb'
6
+ metadata.gz: bd67bb3c81f02873642daefc1b1289edbaa682612348ae3f74d057e6d419ad851f927801e1f0be3b3f9b4784fa7dcfa8adac7755e046624f77994ee518040256
7
+ data.tar.gz: 7b32c1b8e626752a5fb1c92be92a8ff436be825f57862d16104425cd0b4224206f5a4be009b42660a57e10bde154a45f8ed995dbe8d42246db8d54f841b11ca7
data/README.md CHANGED
@@ -191,6 +191,8 @@ results = extractor.extract(schema)
191
191
 
192
192
  ```
193
193
 
194
+ You can also define any class that implements a `call` method and use it as a modifier.
195
+
194
196
  Modifiers are called in the order in which they are defined, so keep that in mind when defining your
195
197
  schema. By default JDE raises an ArgumentError if a modifier is not applicable, but this behaviour
196
198
  can be configured to ignore missing modifiers. See Configuration options for details
@@ -103,7 +103,7 @@ class JsonDataExtractor
103
103
  end
104
104
 
105
105
  def apply_single_modifier(modifier, value)
106
- if modifier.is_a?(Proc)
106
+ if modifier.respond_to?(:call) # Matches Proc, Lambda, Method, and callable objects
107
107
  modifier.call(value)
108
108
  elsif modifiers.key?(modifier)
109
109
  modifiers[modifier].call(value)
data/lib/src/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class JsonDataExtractor
2
- VERSION = '0.0.14'
2
+ VERSION = '0.0.15'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_data_extractor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Buslaev
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-07 00:00:00.000000000 Z
11
+ date: 2024-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -122,7 +122,7 @@ homepage: https://github.com/austerlitz/json_data_extractor
122
122
  licenses:
123
123
  - MIT
124
124
  metadata: {}
125
- post_install_message:
125
+ post_install_message:
126
126
  rdoc_options: []
127
127
  require_paths:
128
128
  - lib
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  version: '0'
139
139
  requirements: []
140
140
  rubygems_version: 3.2.3
141
- signing_key:
141
+ signing_key:
142
142
  specification_version: 4
143
143
  summary: Transform JSON data structures with the help of a simple schema and JsonPath
144
144
  expressions. Use the JsonDataExtractor gem to extract and modify data from complex