Class: WsdlMapper::Naming::SeparatingNamer

Inherits:
DefaultNamer show all
Defined in:
lib/wsdl_mapper/naming/separating_namer.rb

Overview

Namer implementation which puts the generated classes into different namespaces, according to their funtion: Types for types, S8r for serializers and D10r for deserializers.

Constant Summary

Constant Summary

Constants inherited from NamerBase

NamerBase::KEYWORDS

Constants included from Inflector

Inflector::CAPITALS, Inflector::DOWN_FOLLOWED_BY_UP, Inflector::FIRST_CHAR, Inflector::NON_AN, Inflector::NON_WORD, Inflector::NON_WORD_FOLLOWED_BY_WORD

Instance Attribute Summary

Attributes inherited from NamerBase

#module_path

Instance Method Summary (collapse)

Methods inherited from DefaultNamer

#get_attribute_name, #get_content_name, #get_d10r_element_directory_name, #get_d10r_name, #get_d10r_type_directory_name, #get_enumeration_value_name, #get_global_d10r_name, #get_global_s8r_name, #get_inline_type, #get_property_name, #get_s8r_name, #get_s8r_type_directory_name, #get_soap_array_item_name, #get_support_name, #get_type_name

Methods included from Inflector

#camelize, #underscore

Constructor Details

- (SeparatingNamer) initialize(module_path: [], content_attribute_name: 'content', soap_array_item_name: 'item', types_module: ['Types'], s8r_module: ['S8r'], d10r_module: ['D10r'])

Returns a new instance of SeparatingNamer

Parameters:

  • module_path (Array<String>)

    Root module path, e.g. to generate classes in ::MyApi::Types, specify ['MyApi'] as root module path

  • content_attribute_name (String)

    Sets name of the attribute generated for direct content of types. You can change it, if this clashes with attributes in your schema.

  • types_module (Array<String>)

    Where to generate types

  • s8r_module (Array<String>)

    Where to genereate serializers

  • d10r_module (Array<String>)

    Where to generate deserializers



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/wsdl_mapper/naming/separating_namer.rb', line 18

def initialize(module_path: [],
    content_attribute_name: 'content',
    soap_array_item_name: 'item',
    types_module: ['Types'],
    s8r_module: ['S8r'],
    d10r_module: ['D10r'])

  super(module_path: module_path,
      content_attribute_name: content_attribute_name,
      soap_array_item_name: soap_array_item_name)

  @types_module = types_module
  @s8r_module = s8r_module
  @d10r_module = d10r_module
end