Module: SDL::Types::SDLType::ClassMethods

Defined in:
lib/sdl/types/sdl_type.rb,
lib/sdl/exporters/xml_mapping.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#codes(*symbols) ⇒ Array<Symbol> (readonly)

Adds the symbols to be used to refer to this type to the list of codes and returns them.

Parameters:

  • *symbols (Array<Symbol>)

    the symbols to be used

Returns:

  • (Array<Symbol>)

    all resulting symbols



23
24
25
# File 'lib/sdl/types/sdl_type.rb', line 23

def codes
  @codes
end

#wrapped_typeObject (readonly)

The Ruby type, which is to be wrapped

Returns:

  • Class



17
18
19
# File 'lib/sdl/types/sdl_type.rb', line 17

def wrapped_type
  @wrapped_type
end

Instance Method Details

#wraps(type) ⇒ Object

Sets the wrapped Ruby type

Parameters:

  • type

    Class



28
29
30
# File 'lib/sdl/types/sdl_type.rb', line 28

def wraps(type)
  @wrapped_type = type
end

#xml_typeObject



33
34
35
36
37
38
39
# File 'lib/sdl/exporters/xml_mapping.rb', line 33

def xml_type
  if self < SDL::Base::Type
    wrapped_type.xsd_type_name
  else
    'ns:string'
  end
end