active_tools 0.1.0 → 0.1.1

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: 7cf669472ca4f394eed4f88c701b210297b3cf86
4
- data.tar.gz: 2b8b57bd4db879100eba570471c62a9ed087bd1d
3
+ metadata.gz: f43a9ebc2dd27494d5cbed87234480cb4cdf0ba3
4
+ data.tar.gz: 64d747b58c0a83634bab4323b48fad8ea7841a1a
5
5
  SHA512:
6
- metadata.gz: 21cef49c611aa55c42934206f5fb6c93c9c209a7be14463c7f96376a2a4ecfa8161b6397ef43df8242cbb48d78bb6e1ce90ebc5e148390ba1dc595d233492c3f
7
- data.tar.gz: e353c911a674cd4a78e6765e8a8b36feb66b9bf9625fa795089a79f52417da31e16b3a3805277564f5a5c15b3096e9fe0017afc5fdde05425e017a284d7e5e56
6
+ metadata.gz: c4f0be6b3636377cd5b8112d902751687f1a5f1e0b65a48021785e30cb82470deb6820bbd8c5128efabd0cff267d9621cf5342f86f5f3f3c62cef1c5c863996a
7
+ data.tar.gz: beb00d742899400207972944b2287c97412b6f9d463c6310145dc3b1c3420492619895e187e045c51b8b88c0bfa3353966233e1e91489e6fec7375e20d8907a2
@@ -11,10 +11,9 @@ module ActiveTools
11
11
  options = args.extract_options!
12
12
  args.each do |attribute|
13
13
  define_method "#{attribute}=" do |value|
14
- if (options[:if].nil? || (options[:if].is_a?(Proc) && options[:if].call(value) == true)) && (options[:unless].nil? || (options[:unless].is_a?(Proc) && options[:unless].call(value) == false))
15
- if options.has_key?(:force_value)
16
- super(options[:force_value])
17
- end
14
+ case options[:to]
15
+ when Proc then
16
+ super(options[:to].call(value))
18
17
  else
19
18
  super(value)
20
19
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveTools
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Valery Kvon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-18 00:00:00.000000000 Z
11
+ date: 2016-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails