dozer 0.3.1 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dozer/mapperable.rb +6 -5
- data/lib/dozer/version.rb +1 -1
- data/lib/dozer.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62030399ff459ea3faa84a94ad61a07fbe6346bc4d44dd624ebbc45e77d6fb94
|
4
|
+
data.tar.gz: 01fc7b2747cc0e20d5c120aa54fe440f4bb7f319dcb5ceb443db413644534190
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43f96e33fcde5a798e5994f47e8cb3b3f0cb76c47f320d04e8b766d40e1afa552fc72174e94074e6740b8077627386fd000954ed2f14644a404aa37c8314a72d
|
7
|
+
data.tar.gz: ab843c5dde18a4b7e02d6983d92fa26b2a664314e011b8c96b280a2e2b0dbfc0c57abc4cab4de0aac547d4d2fed303955cced5aed354fffe7dc54812ef0fbc8d
|
data/lib/dozer/mapperable.rb
CHANGED
@@ -3,13 +3,14 @@ module Dozer
|
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
5
|
included do
|
6
|
-
attr_accessor :input, :output
|
6
|
+
attr_accessor :input, :output, :options
|
7
7
|
end
|
8
8
|
|
9
|
-
def initialize(input)
|
9
|
+
def initialize(input, data = {})
|
10
10
|
@input = input.with_indifferent_access
|
11
11
|
@output = ActiveSupport::HashWithIndifferentAccess.new
|
12
|
-
|
12
|
+
@options = data&.with_indifferent_access || {}
|
13
|
+
end
|
13
14
|
|
14
15
|
module ClassMethods
|
15
16
|
|
@@ -17,8 +18,8 @@ module Dozer
|
|
17
18
|
append_rule(Dozer::Rule.new(options))
|
18
19
|
end
|
19
20
|
|
20
|
-
def transform(input)
|
21
|
-
instance = self.new(input)
|
21
|
+
def transform(input, data={})
|
22
|
+
instance = self.new(input, data)
|
22
23
|
all_rules.each { |rule| rule.apply!(instance) }
|
23
24
|
instance.output
|
24
25
|
end
|
data/lib/dozer/version.rb
CHANGED
data/lib/dozer.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dozer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Workstream.us
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
|
-
rubygems_version: 3.
|
126
|
+
rubygems_version: 3.4.19
|
127
127
|
signing_key:
|
128
128
|
specification_version: 4
|
129
129
|
summary: map a hash from one schema to another schema
|