Class: SavonHelper::IntegerMapping
- Inherits:
-
TypeMapping
- Object
- TypeMapping
- SavonHelper::IntegerMapping
- Defined in:
- lib/savon_helper/type_mappings.rb
Overview
IntegerMapping maps Savon data to Ruby integers.
Instance Attribute Summary
Attributes inherited from TypeMapping
Converting collapse
-
#to_native(data, interface) ⇒ Integer
Convert from Savon data to Ruby integers.
-
#to_savon(value) ⇒ String
Convert from Ruby float type to Savon data.
Instance Method Summary collapse
- #default_value ⇒ Object abstract
-
#object_klass ⇒ Integer
Return the class represented by the mapping.
-
#type_string ⇒ String
Return the class description represented by the mapping.
Methods inherited from TypeMapping
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.
133 134 135 |
# File 'lib/savon_helper/type_mappings.rb', line 133 def default_value 0 end |
#object_klass ⇒ Integer
Return the class represented by the mapping.
121 122 123 |
# File 'lib/savon_helper/type_mappings.rb', line 121 def object_klass Integer end |
#to_native(data, interface) ⇒ Integer
Convert from Savon data to Ruby integers
106 107 108 |
# File 'lib/savon_helper/type_mappings.rb', line 106 def to_native(data, interface) Integer(data.to_s) end |
#to_savon(value) ⇒ String
Convert from Ruby float type to Savon data
113 114 115 |
# File 'lib/savon_helper/type_mappings.rb', line 113 def to_savon(value) value.to_s end |
#type_string ⇒ String
Return the class description represented by the mapping.
127 128 129 |
# File 'lib/savon_helper/type_mappings.rb', line 127 def type_string "int" end |