Class: SavonHelper::HintMapping

Inherits:
TypeMapping show all
Defined in:
lib/savon_helper/type_mappings.rb

Overview

HintMapping maps Savon data to Ruby objects of type klass (r/o).

Direct Known Subclasses

ObjectMapping

Instance Attribute Summary

Attributes inherited from TypeMapping

#description, #name

Instance Method Summary collapse

Methods inherited from TypeMapping

#default_value, #to_native, #to_savon

Constructor Details

#initialize(klass, name = '', description = '') ⇒ HintMapping

A new instance of ObjectMapping with description for class klass.

Parameters:

  • klass (Class)

    A class returned by the hint accessor

  • description (String) (defaults to: '')


332
333
334
335
# File 'lib/savon_helper/type_mappings.rb', line 332

def initialize(klass, name='', description='')
  super(name, description)
  @klass = klass
end

Instance Method Details

#object_klassClass

This method is abstract.

Return the class represented by the mapping.

Returns:

  • (Class)


341
342
343
# File 'lib/savon_helper/type_mappings.rb', line 341

def object_klass
  @klass
end

#type_stringString

Return the class description represented by the mapping.

Returns:



347
348
349
# File 'lib/savon_helper/type_mappings.rb', line 347

def type_string
  "HINT<#{@klass.name_without_namespace}>"
end