Class: IPAddr

Inherits:
Object show all
Defined in:
lib/user_input.rb

Class Method Summary collapse

Class Method Details

.from_user_input(value) ⇒ Object



216
217
218
219
220
221
222
223
224
225
# File 'lib/user_input.rb', line 216

def IPAddr.from_user_input(value)
	if (value.kind_of?(self))
		return value
	end
	begin
		return self.new(value.to_s)
	rescue ArgumentError
		return nil
	end
end