Don't traverse ancestors when checking if schema is defined
This commit is contained in:
parent
5b45f8f351
commit
c02f2ce6a4
|
@ -74,20 +74,20 @@ module Google
|
|||
Google::INFLECTOR.camelize(api.name)
|
||||
api_version_string =
|
||||
Google::INFLECTOR.camelize(api.version).gsub('.', '_')
|
||||
if Google::APIClient::Schema.const_defined?(api_name_string)
|
||||
api_name = Google::APIClient::Schema.const_get(api_name_string)
|
||||
if Google::APIClient::Schema.const_defined?(api_name_string, false)
|
||||
api_name = Google::APIClient::Schema.const_get(api_name_string, false)
|
||||
else
|
||||
api_name = Google::APIClient::Schema.const_set(
|
||||
api_name_string, Module.new
|
||||
)
|
||||
end
|
||||
if api_name.const_defined?(api_version_string)
|
||||
api_version = api_name.const_get(api_version_string)
|
||||
if api_name.const_defined?(api_version_string, false)
|
||||
api_version = api_name.const_get(api_version_string, false)
|
||||
else
|
||||
api_version = api_name.const_set(api_version_string, Module.new)
|
||||
end
|
||||
if api_version.const_defined?(schema_name)
|
||||
schema_class = api_version.const_get(schema_name)
|
||||
if api_version.const_defined?(schema_name, false)
|
||||
schema_class = api_version.const_get(schema_name, false)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue