object_struct 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/lib/object_struct/object_struct.rb +2 -2
- metadata +3 -3
data/CHANGELOG
CHANGED
@@ -25,7 +25,7 @@
|
|
25
25
|
# @abstract You probably want to subclass ObjectStruct, to reflect your business
|
26
26
|
# entities. See the README for example use.
|
27
27
|
class ObjectStruct < OpenStruct
|
28
|
-
VERSION = '0.0.
|
28
|
+
VERSION = '0.0.4'
|
29
29
|
|
30
30
|
# Delegated to Hash#each
|
31
31
|
def each &blk
|
@@ -74,7 +74,7 @@ class ObjectStruct < OpenStruct
|
|
74
74
|
if name =~ /^has_([a-z_]+)\?$/
|
75
75
|
if respond_to? (field = $1.to_sym)
|
76
76
|
result = (send field)
|
77
|
-
if result.
|
77
|
+
if (result.kind_of? Enumerable) && result.respond_to?(:count)
|
78
78
|
(result.count > 0)
|
79
79
|
else
|
80
80
|
result ? true : false
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 4
|
9
|
+
version: 0.0.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Quid, Inc.
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-09-
|
17
|
+
date: 2010-09-23 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|