Module: RubyAem::Swagger
- Defined in:
- lib/ruby_aem/swagger.rb
Overview
Swagger module contains logic related to swagger_aem.
Class Method Summary collapse
-
.operation_to_method(operation) ⇒ Object
Convert ruby_aem spec’s operation (consistent with Swagger spec’s operationId) into swagger_aem’s generated method name.
-
.path(path) ⇒ Object
Sanitise path value by removing leading and trailing slashes swagger_aem accepts paths without those slashes.
-
.property_to_parameter(property) ⇒ Object
Convert ruby_aem spec’s property name (by replacing dots with underscores) into swagger_aem’s generated parameter name.
Class Method Details
.operation_to_method(operation) ⇒ Object
Convert ruby_aem spec’s operation (consistent with Swagger spec’s operationId) into swagger_aem’s generated method name.
26 27 28 29 30 |
# File 'lib/ruby_aem/swagger.rb', line 26 def Swagger.operation_to_method(operation) operation.gsub(/[A-Z]/) { |char| '_' + char.downcase } end |
.path(path) ⇒ Object
Sanitise path value by removing leading and trailing slashes swagger_aem accepts paths without those slashes.
46 47 48 |
# File 'lib/ruby_aem/swagger.rb', line 46 def Swagger.path(path) path.gsub(/^\//, '').gsub(/\/$/, '') end |
.property_to_parameter(property) ⇒ Object
Convert ruby_aem spec’s property name (by replacing dots with underscores) into swagger_aem’s generated parameter name.
37 38 39 |
# File 'lib/ruby_aem/swagger.rb', line 37 def Swagger.property_to_parameter(property) property.gsub(/\./, '_') end |