Cleaning up the changes made by @vapir.

This commit is contained in:
Bob Aman committed 2012-02-27 12:14:11 +01:00
1 parent af61568cbe
commit 1e5f09a594
2 files changed
+69 -20

No files matched your search

+6 -2
View File
@@ -47,8 +47,12 @@ module Google
# and excess object creation, but this hopefully shouldn't be an
# issue since it should only be called only once per schema per
# process.
if data.kind_of?(Hash) && data['$ref'].is_a?(String)
reference = data['$ref']
if data.kind_of?(Hash) && data['$ref']
if data['$ref'].respond_to?(:to_str)
reference = data['$ref'].to_str
else
raise TypeError, "Expected String, got #{data['$ref'].class}"
end
reference = '#' + reference if reference[0..0] != '#'
data.merge({
'$ref' => reference