object_struct 0.0.6 → 0.0.7

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.7 (October 4, 2010)
2
+
3
+ Made to_h method public, so results can be converted to hash
4
+
1
5
  ## 0.0.6 (October 4, 2010)
2
6
 
3
7
  Handle has_id? calls by checking table, not ruby object ids
@@ -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.6'
28
+ VERSION = '0.0.7'
29
29
 
30
30
  # Delegated to Hash#each
31
31
  def each &blk
@@ -91,6 +91,12 @@ class ObjectStruct < OpenStruct
91
91
  def id
92
92
  object_id
93
93
  end
94
+
95
+ def to_h
96
+ result = {}
97
+ @table.each {|name, value| result[name.to_s] = value}
98
+ result
99
+ end
94
100
 
95
101
  protected
96
102
 
@@ -134,12 +140,6 @@ class ObjectStruct < OpenStruct
134
140
 
135
141
  private
136
142
 
137
- def to_h
138
- result = {}
139
- @table.each {|name, value| result[name.to_s] = value}
140
- result
141
- end
142
-
143
143
  def self.value_maybe_promise(key, value)
144
144
  case value
145
145
  when Array, Hash
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 6
9
- version: 0.0.6
8
+ - 7
9
+ version: 0.0.7
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-10-04 00:00:00 -07:00
17
+ date: 2010-10-07 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency