shameless 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/shameless/model.rb +12 -8
- data/lib/shameless/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ada388329571a9d4e7401b2258bd315cd92f9219
|
4
|
+
data.tar.gz: d12bbf07ca0ede9db4f4ea79b21048b0eeeab4b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df9d74db8abe98a8b5437511a35af4e159ae224d6db17e8fe3870acf12311a9bd407221248ca2a081c866b49da903283b37f8f423c6dc62ad11643cb924c006f
|
7
|
+
data.tar.gz: '0638d93b2c824cf7c4fa39b8454ec13ef8ae667f159a6ed8fe691b441334c6731c34f57022ce7a1d9297834ebae02b985897914a7e6ea57e4293212b668c2997'
|
data/CHANGELOG.md
CHANGED
data/lib/shameless/model.rb
CHANGED
@@ -8,6 +8,8 @@ module Shameless
|
|
8
8
|
def attach_to(store, name)
|
9
9
|
@store = store
|
10
10
|
@name = name || self.name.downcase # TODO use activesupport?
|
11
|
+
@cell_names = []
|
12
|
+
cell(Cell::BASE)
|
11
13
|
|
12
14
|
include(InstanceMethods)
|
13
15
|
end
|
@@ -22,10 +24,16 @@ module Shameless
|
|
22
24
|
|
23
25
|
def cell(name)
|
24
26
|
name = name.to_s
|
27
|
+
@cell_names << name
|
25
28
|
|
26
|
-
define_method(name)
|
27
|
-
|
28
|
-
|
29
|
+
define_method(name) { @cells[name] }
|
30
|
+
end
|
31
|
+
|
32
|
+
def initialize_cells(instance, base_body)
|
33
|
+
Hash[@cell_names.map do |name|
|
34
|
+
cell = name == Cell::BASE ? Cell.base(instance, base_body) : Cell.new(instance, name)
|
35
|
+
[name, cell]
|
36
|
+
end]
|
29
37
|
end
|
30
38
|
|
31
39
|
def put(values)
|
@@ -109,11 +117,7 @@ module Shameless
|
|
109
117
|
|
110
118
|
def initialize(uuid, base_body = nil)
|
111
119
|
@uuid = uuid
|
112
|
-
@cells =
|
113
|
-
end
|
114
|
-
|
115
|
-
def base
|
116
|
-
@cells[Cell::BASE]
|
120
|
+
@cells = self.class.initialize_cells(self, base_body)
|
117
121
|
end
|
118
122
|
|
119
123
|
def [](field)
|
data/lib/shameless/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shameless
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Olek Janiszewski
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|