Module: MlaActiveDutyStatus::Response

Defined in:
lib/mla_active_duty_status/response.rb

Class Method Summary collapse

Class Method Details

.parse_response(pdf) ⇒ Object

lines look like:

Based on the information you provided DMDC does not possess information indicating that the individual is either on active duty for more than 30 days or a family member of a service member on active duty or Based on the information you provided DMDC does possess information indicating that the individual is either on active duty for more than 30 days or a family member of a service member on active duty

Yes, the only difference is the presence of “not”.



14
15
16
17
18
19
20
21
# File 'lib/mla_active_duty_status/response.rb', line 14

def self.parse_response(pdf)
  pdf.force_encoding('UTF-8')
  reader = PDF::Reader.new(StringIO.new(pdf))
  status_text =reader.pages.first.text.split("\n")[25]
  status_text.include?('not') ? MLA_NOT_ACTIVE_DUTY : MLA_ACTIVE_DUTY
rescue
  MLA_ERROR
end