Class: Peanuts::Converter::Convert_integer
- Inherits:
-
Convert_string
- Object
- 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
Constructor Details
#initialize(options) ⇒ Convert_integer
Returns a new instance of Convert_integer.
121 122 123 |
# File 'lib/peanuts/converters.rb', line 121 def initialize() super end |
Instance Method Details
#from_xml(string) ⇒ Object
129 130 131 |
# File 'lib/peanuts/converters.rb', line 129 def from_xml(string) (string = super(string)) && Integer(string) end |
#to_xml(int) ⇒ Object
125 126 127 |
# File 'lib/peanuts/converters.rb', line 125 def to_xml(int) super(int.to_s) end |