lib/carrier_info/sources/safer.rb in carrier_info-0.0.3 vs lib/carrier_info/sources/safer.rb in carrier_info-0.0.4
- old
+ new
@@ -175,12 +175,13 @@
parts = parse_standard_info_field("MCS-150 Mileage (Year)").split(" ")
parts[1].gsub(/\D/,"").to_i if parts.count == 2
end
def parse_out_of_service_date
- parse_standard_info_field("Out of Service Date")
- # date_parts = parse_standard_info_field("Out of Service Date").split("/").collect(&:to_i)
- # Date.new(date_parts[2], date_parts[0], date_parts[1]) if date_parts.count == 3
+ date_parts = parse_standard_info_field("Out of Service Date").split("/").collect(&:to_i)
+ if date_parts.count == 3
+ Date.new(date_parts[2], date_parts[0], date_parts[1]) if date_parts.count == 3
+ end
end
def parse_safer_active
!(response.xpath("//text()='Record Inactive'") || response.xpath("//text()='Record Not Found'"))
end
\ No newline at end of file