transformable 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/transformable.rb CHANGED
@@ -12,9 +12,12 @@ module Transformable
12
12
 
13
13
  define_method "#{attr}=" do |value|
14
14
  new_value = yield(value)
15
+ puts new_value
15
16
  instance_variable_set("@#{attr}", new_value)
16
- write_attribute(attr, new_value) if respond_to? :write_attribute
17
- new_value
17
+ begin
18
+ write_attribute(attr, new_value)
19
+ rescue NoMethodError
20
+ end
18
21
  end
19
22
  end
20
23
  end
@@ -1,3 +1,3 @@
1
1
  module Transformable
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transformable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-30 00:00:00.000000000 Z
12
+ date: 2012-07-30 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: Lets you manipulate data as it's being set on an object without a lot
15
15
  of setter method boilerplate