field_mapper 0.2.9 → 0.3.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
  SHA1:
3
- metadata.gz: a2254aa7007d765eddc8105deb19e45f7ccf0814
4
- data.tar.gz: 06f47cd9a1151bf4e60d0b1595aa7db50055ef5d
3
+ metadata.gz: ce39c6b7c34a6d374ac954c8b363b4b8836189a9
4
+ data.tar.gz: c095ddb362a9e9a58c563bb6f5b2560d7ccc47b0
5
5
  SHA512:
6
- metadata.gz: 192194c8fd891e56092f3a88af4e821e024d3fac7d218b608585d4fd8bc6282fa109e8d83f11bbb77149f64318c71c62ca4f282bdd37af0e90bbade7bc486ae2
7
- data.tar.gz: 876375655e654407a62134a67dff94d83da5d4575c74a9e37c8b3677a2604217ba987479c3b3d6afb110b0cfb3166cdf02d3d0df2781f75a7e86a74cc6bb443d
6
+ metadata.gz: 3534a25c5d9b804d4ee358e0268ee923f62611134fe672a76053bb211e889f0f5ecadef9147595219d658ea80d9d6380caeafdd0e8d5df984e02e5cec6e8f787
7
+ data.tar.gz: a7fd0752dbb928571392bd9229416f26269340322041ca2b29a38ea64fdb88aa18ae59ecf4473a230046dd83579b897aae4983e491707db7594800d71978a833
@@ -100,7 +100,7 @@ module FieldMapper
100
100
  def []=(field_name, value)
101
101
  field = self.class.find_field(field_name)
102
102
  raise FieldNotDefined if field.nil?
103
- instance_variable_set "@#{attr_name(field_name)}", field.cast(value)
103
+ assign_param field_name, field.cast(value)
104
104
  end
105
105
 
106
106
  def to_hash(flatten: false, history: {}, include_meta: true, placeholders: false)
@@ -245,6 +245,9 @@ module FieldMapper
245
245
  end
246
246
 
247
247
  def assign_param(name, value)
248
+ if defined? before_assign_param
249
+ value = before_assign_param(name, value)
250
+ end
248
251
  instance_variable_set "@#{attr_name(name)}", value
249
252
  end
250
253
 
@@ -1,3 +1,3 @@
1
1
  module FieldMapper
2
- VERSION = "0.2.9"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: field_mapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Hopkins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-18 00:00:00.000000000 Z
11
+ date: 2014-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport