Method: DeliveryStateJp::Base.delivery_state

Defined in:
lib/delivery_state_jp/base.rb

.delivery_state(args) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/delivery_state_jp/base.rb', line 5

def self.delivery_state(args)
  doc = Nokogiri::HTML.parse(response_body(args), nil, charset)
  index = 1
  statuses = []
  while doc.xpath(xpath(index)).text.strip != ''
    statuses << doc.xpath(xpath(index)).text.strip
    index += 1
  end
  statuses.last
end