cot 0.4.2 → 0.4.3

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: aa8903cd5e703422db57575411b464c7ec5b156a
4
- data.tar.gz: 193b05ad13a36ac2d81a74637293e475c3a30ca2
3
+ metadata.gz: 60707b16fa5c3be311bec710700f84d2014b9b1e
4
+ data.tar.gz: aad0be8b2404c946d70f6ad35ad41fff0907e08d
5
5
  SHA512:
6
- metadata.gz: 43371ff3f3487036d52a1a20b77124d2343d481086f28bf4fb66ca9931502e7c404bf9581eed999c0955cf5f15c22271e3e34fa9e859e6756e38a495a57a718a
7
- data.tar.gz: cb310e1923f79143151107a448a209d839fadb669f07d816428740ecd157402209a81a80292795acce9eafd5c6504ffe3a84a834857d18543cb942e3715da10f
6
+ metadata.gz: 308b42d5847d369aaa86a12ea6d9d7fd3f253cafe041e89479a1a0d0395b060e5336e4581f4391663003b8d1b6a9b4b87def79ae79733753493d8552d50ba918
7
+ data.tar.gz: 8ea6633725178c97272abb7873df54d977c5df6d618e81df211510ab5868b51fbf40d54a559fd5f8b921ae15fd96cab228297eafc5703d581ac27bc001932bcf
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cot (0.4.1)
4
+ cot (0.4.2)
5
5
  activemodel
6
6
 
7
7
  GEM
data/lib/cot/frame.rb CHANGED
@@ -49,6 +49,10 @@ module Cot
49
49
  end
50
50
 
51
51
  def []=(key, value)
52
+ if self.class.value_blocks[key]
53
+ block = self.class.value_blocks[key]
54
+ value = instance_exec(value, &block)
55
+ end
52
56
  @data[convert_key key] = value
53
57
  end
54
58
 
data/lib/cot/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cot
2
- VERSION = '0.4.2'
2
+ VERSION = '0.4.3'
3
3
  end
@@ -154,6 +154,13 @@ describe Cot::Frame do
154
154
  expect(@foo.thing).to be_kind_of Foo
155
155
  expect(@foo.thing.params[:passed]).to eq 42
156
156
  end
157
+
158
+ it 'sets the value on []=' do
159
+ bar = TestObject.new(id: 42)
160
+ bar.thing = { key: 'this will be in foo' }
161
+ expect(bar.thing).to be_kind_of Foo
162
+ expect(bar.thing.params[:passed]).to eq 42
163
+ end
157
164
  end
158
165
  end
159
166
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Henrich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-02 00:00:00.000000000 Z
11
+ date: 2014-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel