Class: Peanuts::Converter::Convert_integer

Inherits:
Convert_string show all
Defined in:
lib/peanuts/converters.rb

Overview

An integer.

Specifier

:integer

Options

Accepts all options of Convert_string.

Instance Method Summary collapse

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(options)
  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