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 CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.0.4 (September 23, 2010)
2
+
3
+ More presumptous fixes for has_related?
4
+
1
5
  ## 0.0.3 (September 22, 2010)
2
6
 
3
7
  Fix failing has_property_name? test. API change: has_property_name? is
@@ -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.3'
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.respond_to?(:count) && result.method(:count).arity < 1
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
- - 3
9
- version: 0.0.3
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-22 00:00:00 -07:00
17
+ date: 2010-09-23 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency