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 Method Summary collapse

Methods inherited from TypeMapping

#default_value, #description, #to_native, #to_savon, #warn_unparseable_data

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: '')


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

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)


354
355
356
# File 'lib/savon_helper/type_mappings.rb', line 354

def object_klass
  @klass
end

#type_stringString

Return the class description represented by the mapping.

Returns:



360
361
362
# File 'lib/savon_helper/type_mappings.rb', line 360

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