Class: SavonHelper::StringMapping
- Inherits:
-
TypeMapping
- Object
- TypeMapping
- SavonHelper::StringMapping
- Defined in:
- lib/savon_helper/type_mappings.rb
Overview
StringMapping maps Savon data to Ruby strings.
Direct Known Subclasses
Converting collapse
-
#to_native(data, interface) ⇒ String
Convert from Savon data to Ruby strings.
-
#to_savon(value) ⇒ String
Convert from Ruby string type to Savon data.
Instance Method Summary collapse
- #default_value ⇒ Object abstract
- #object_klass ⇒ Class abstract
-
#type_string ⇒ String
Return the class description represented by the mapping.
Methods inherited from TypeMapping
#description, #initialize, #warn_unparseable_data
Constructor Details
This class inherits a constructor from SavonHelper::TypeMapping
Instance Method Details
#default_value ⇒ Object
This method is abstract.
Return the default value the mapping.
229 230 231 |
# File 'lib/savon_helper/type_mappings.rb', line 229 def default_value "" end |
#object_klass ⇒ Class
This method is abstract.
Return the class represented by the mapping.
TODO:
Is this really neccessary?
217 218 219 |
# File 'lib/savon_helper/type_mappings.rb', line 217 def object_klass String end |
#to_native(data, interface) ⇒ String
Convert from Savon data to Ruby strings
201 202 203 |
# File 'lib/savon_helper/type_mappings.rb', line 201 def to_native(data, interface) data.to_s end |
#to_savon(value) ⇒ String
Convert from Ruby string type to Savon data
208 209 210 |
# File 'lib/savon_helper/type_mappings.rb', line 208 def to_savon(value) value.to_s end |
#type_string ⇒ String
Return the class description represented by the mapping.
223 224 225 |
# File 'lib/savon_helper/type_mappings.rb', line 223 def type_string "String" end |