Skip to content

Commit

Permalink
Add Struct#to_h method. [major]
Browse files Browse the repository at this point in the history
  • Loading branch information
trans committed Jul 8, 2012
1 parent 5c725e2 commit 3b7f92b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/core/facets/struct/to_h.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class Struct

# Returns a hash containing the names and values
# for all instance settings in the Struct.

def to_h
h = {}
each_pair{ |k,v| h[k] = v }
h
end

end

0 comments on commit 3b7f92b

Please sign in to comment.