Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
support custom Hash subclasses
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Nov 5, 2011
1 parent c822ed1 commit a5b9ce3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/twin.rb
Expand Up @@ -150,9 +150,10 @@ def normalize_user(user)
end

def convert_twin_hash(object)
if Hash === object then object
elsif object.respond_to? :to_twin_hash
if object.respond_to? :to_twin_hash
object.to_twin_hash
elsif Hash === object
object
elsif object.respond_to? :attributes
object.attributes
else
Expand Down

0 comments on commit a5b9ce3

Please sign in to comment.