Class: Google::Apis::DiscoveryV1::RestDescription

Inherits:
Object
  • Object
show all
Defined in:
lib/google/apis/generator/model.rb

Defined Under Namespace

Classes: Auth

Constant Summary collapse

PARAMETER_BLACKLIST =

Don't expose these in the API directly.

%w(alt access_token bearer_token oauth_token pp prettyPrint
$.xgafv callback upload_protocol uploadType)

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#force_alt_jsonObject Also known as: force_alt_json?

Returns the value of attribute force_alt_json.



122
123
124
# File 'lib/google/apis/generator/model.rb', line 122

def force_alt_json
  @force_alt_json
end

Instance Method Details

#all_methodsObject



158
159
160
161
162
163
# File 'lib/google/apis/generator/model.rb', line 158

def all_methods
  m = []
  m << api_methods.values unless api_methods.nil?
  m << resources.map { |_k, r| r.all_methods } unless resources.nil?
  m.flatten
end

#api_methodsObject



150
151
152
# File 'lib/google/apis/generator/model.rb', line 150

def api_methods
  Hash[(@api_methods || {}).sort]
end

#module_nameObject



137
138
139
# File 'lib/google/apis/generator/model.rb', line 137

def module_name
  name + version
end

#nameObject



133
134
135
# File 'lib/google/apis/generator/model.rb', line 133

def name
  ActiveSupport::Inflector.camelize(@name)
end

#parametersObject



165
166
167
# File 'lib/google/apis/generator/model.rb', line 165

def parameters
  Hash[(@parameters || {}).sort].delete_if { |k, _v| PARAMETER_BLACKLIST.include?(k) }
end

#qualified_nameObject



141
142
143
# File 'lib/google/apis/generator/model.rb', line 141

def qualified_name
  sprintf('Google::Apis::%s', module_name)
end

#resourcesObject



154
155
156
# File 'lib/google/apis/generator/model.rb', line 154

def resources
  Hash[(@resources || {}).sort]
end

#schemasObject



169
170
171
# File 'lib/google/apis/generator/model.rb', line 169

def schemas
  Hash[(@schemas || {}).sort]
end

#service_nameObject



145
146
147
148
# File 'lib/google/apis/generator/model.rb', line 145

def service_name
  class_name = (canonical_name || name).gsub(/\W/, '')
  ActiveSupport::Inflector.camelize(sprintf('%sService', class_name))
end

#versionObject



129
130
131
# File 'lib/google/apis/generator/model.rb', line 129

def version
  ActiveSupport::Inflector.camelize(@version.gsub(/\W/, '-')).gsub(/-/, '_')
end