lib/ferver/file_id_request.rb in ferver-1.2.1 vs lib/ferver/file_id_request.rb in ferver-1.3.0
- old
+ new
@@ -8,30 +8,25 @@
self.value = value
end
def value=(value)
- id = parse_value(value)
-
- if id.nil?
- @is_valid = false
- else
- @value = id
- @is_valid = true
- end
+ @value = parse_value(value)
end
def valid?
@is_valid
end
private
def parse_value(value)
begin
- Integer(value)
+ int_val = Integer(value)
+ @is_valid = true
+ int_val
rescue
- nil
+ @is_valid = false
end
end
end
end