Class: Peanuts::Converter::Convert_integer
- Inherits:
-
Convert_string
- Object
- Peanuts::Converter
- Convert_string
- Peanuts::Converter::Convert_integer
- Defined in:
- lib/peanuts/converters.rb
Overview
An integer.
- Specifier
-
:integer
Options
Accepts all options of Convert_string
.
Instance Method Summary collapse
- #from_xml(string) ⇒ Object
-
#initialize(options) ⇒ Convert_integer
constructor
A new instance of Convert_integer.
- #to_xml(int) ⇒ Object
Methods inherited from Peanuts::Converter
create, create!, lookup, lookup!
Constructor Details
#initialize(options) ⇒ Convert_integer
Returns a new instance of Convert_integer.
130 131 132 |
# File 'lib/peanuts/converters.rb', line 130 def initialize() super end |
Instance Method Details
#from_xml(string) ⇒ Object
138 139 140 |
# File 'lib/peanuts/converters.rb', line 138 def from_xml(string) (string = super(string)) && Integer(string) end |
#to_xml(int) ⇒ Object
134 135 136 |
# File 'lib/peanuts/converters.rb', line 134 def to_xml(int) super(int.to_s) end |