Class: Swgr2rb::EndpointClassGenerator

Inherits:
RubyFileGenerator show all
Defined in:
lib/endpoint_class_generator/endpoint_class_generator.rb

Overview

EndpointClassGenerator generates a Ruby class file for an endpoint object model from its config.

Constant Summary

Constants included from RubyFileGeneratorConstants

RubyFileGeneratorConstants::CAMEL_CASE_TO_SNAKE_CASE, RubyFileGeneratorConstants::CLASS_NAME, RubyFileGeneratorConstants::COMMENT_ADD_SUB_RESULTS, RubyFileGeneratorConstants::COMMENT_SET_VALID_VALUES, RubyFileGeneratorConstants::END_POINT_PATH, RubyFileGeneratorConstants::EXPECTED_CODE, RubyFileGeneratorConstants::EXPECTED_SCHEMA, RubyFileGeneratorConstants::GENERATE_BODY, RubyFileGeneratorConstants::GENERATE_HEADERS, RubyFileGeneratorConstants::GET_PARAM_FROM_REQUEST_OPTIONS, RubyFileGeneratorConstants::GET_PARAM_FROM_REQUEST_PARAMS, RubyFileGeneratorConstants::INCLUDES, RubyFileGeneratorConstants::INITIALIZE, RubyFileGeneratorConstants::JSON_VALIDATOR_VALIDATE_SCHEMA, RubyFileGeneratorConstants::MODULE_NAME, RubyFileGeneratorConstants::MULTIPART_REQUEST_BODY, RubyFileGeneratorConstants::RAISE_UNLESS_PARAMS_PASSED, RubyFileGeneratorConstants::REQUIRES, RubyFileGeneratorConstants::SNAKE_CASE_TO_CAMEL_CASE, RubyFileGeneratorConstants::VALIDATE_RESPONSE_SCHEMA

Instance Method Summary collapse

Methods inherited from RubyFileGenerator

#generate_file, #initialize

Constructor Details

This class inherits a constructor from Swgr2rb::RubyFileGenerator

Instance Method Details

#generate_linesObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/endpoint_class_generator/endpoint_class_generator.rb', line 10

def generate_lines
  [generate_requires,
   generate_class_name,
   generate_modules_to_include,
   generate_initialize_method,
   generate_validate_response_schema_method,
   'private',
   generate_end_point_path_method,
   generate_generate_headers_method,
   generate_generate_body_method,
   'end'].compact.flatten
end