serialist 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/serialist/serialist_module.rb +4 -4
- data/serialist.gemspec +2 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.1
|
@@ -25,13 +25,13 @@ module Serialist
|
|
25
25
|
define_method field.to_s + "?" do |*param|
|
26
26
|
return false unless (slug = self.send(serialist_field))
|
27
27
|
if param.empty?
|
28
|
-
![nil, false, "false", :false].include?(slug[field])
|
28
|
+
![nil, false, "false", :false].include?(slug[field.to_sym])
|
29
29
|
else
|
30
30
|
slug[field.to_sym] == param.first
|
31
31
|
end
|
32
32
|
end
|
33
33
|
define_method field.to_s + "=" do |param|
|
34
|
-
|
34
|
+
self.send(serialist_field.to_s + "=", Hash.new) unless self.send(serialist_field)
|
35
35
|
self.send(serialist_field)[field.to_sym] = param
|
36
36
|
end
|
37
37
|
end
|
@@ -54,7 +54,7 @@ module Serialist
|
|
54
54
|
attributes.each do |k, v|
|
55
55
|
unless k.include?("(") || respond_to?(:"#{k}=")
|
56
56
|
self.class.send(:define_method, :"#{k}=") do |param|
|
57
|
-
|
57
|
+
self.send(self.class.serialist_field.to_s + "=", Hash.new) unless self.send(self.class.serialist_field)
|
58
58
|
self.send(self.class.serialist_field)[k.to_sym] = param
|
59
59
|
end
|
60
60
|
end
|
@@ -76,7 +76,7 @@ module Serialist
|
|
76
76
|
slug && (slug[method.to_s[0..-2].to_sym] == args.first)
|
77
77
|
end
|
78
78
|
when "="
|
79
|
-
|
79
|
+
self.send(slug.to_s + "=", Hash.new) unless slug
|
80
80
|
self.send(self.class.serialist_field)[method.to_s[0..-2].to_sym] = args.first
|
81
81
|
else
|
82
82
|
slug && slug[method.to_sym]
|
data/serialist.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{serialist}
|
8
|
-
s.version = "0.5.
|
8
|
+
s.version = "0.5.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Benoit B\303\251n\303\251zech"]
|
12
|
-
s.date = %q{2009-09-
|
12
|
+
s.date = %q{2009-09-17}
|
13
13
|
s.description = %q{Serialize any data, set and fetch it like any column attributes}
|
14
14
|
s.email = %q{benoit.benezech@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serialist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Benoit B\xC3\xA9n\xC3\xA9zech"
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-09-
|
12
|
+
date: 2009-09-17 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|