dozer 0.3.1 → 0.3.2

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: 836066ffb0fbb3e71155b9c8c5310429caae2ab5c461a482758dbbe3e0e7d94f
4
- data.tar.gz: 6a513410751eee299ee93c4eef48aabf880dfcf6ddf2c74113925b52295f30be
3
+ metadata.gz: 87b4851a11a83f14e78ff8c3f3c975a42eb70a88d4dc6e4c9e6bea83e475374b
4
+ data.tar.gz: 74dea50634b680aa55ad6c65e041f32e4709a00bd21e2568196c0568dd2a5d59
5
5
  SHA512:
6
- metadata.gz: 74be06f97c5baa3fa776e82187ed262b1276f33973a62d2cd1ca0c0a46a0ba77c3bf82ea723df4b4be19b837959b785f632636b1d761097d1b3d1d7d03f9f34e
7
- data.tar.gz: 357302fad4df18f5dcebbc3aa6cd5e4270c4342d6b9192b3a629e986f74705ab1fd34d31f1e97e1f8dfdae6029a911e0148b237212e3c6f9aeb770d3365d0d11
6
+ metadata.gz: 9091b06596a3ec2adbe8584ca03df3253e6f8fc6bb692f725659c31a73f93ed8156eb27577adbf51e5de8620a65f51620dad040811f37888ae054b34c7e03646
7
+ data.tar.gz: 0d9f6f598cab72c01c8e60ea6eff1899d07e4c96195f1403e76ec3beae00356660ef4d22bdea8de02373d6d30e9bbc8ef3b86f835f259a605387f43dc3b59ef4
@@ -3,12 +3,13 @@ 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
+ @options = data.with_indifferent_access
12
13
  end
13
14
 
14
15
  module ClassMethods
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Dozer
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
data/lib/dozer.rb CHANGED
@@ -9,6 +9,6 @@ module Dozer
9
9
 
10
10
  # transform the data from one schema to another schema.
11
11
  def self.map(hash, mapper, options={})
12
- mapper.transform(hash)
12
+ mapper.transform(hash, options)
13
13
  end
14
14
  end
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.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Workstream.us
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-17 00:00:00.000000000 Z
11
+ date: 2023-11-28 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.0.6
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