lib/takuhai_status/sagawa.rb in takuhai_status-1.7.4 vs lib/takuhai_status/sagawa.rb in takuhai_status-1.8.1

- old
+ new

@@ -2,12 +2,14 @@ require 'nokogiri' module TakuhaiStatus class Sagawa attr_reader :key, :time, :state + TakuhaiStatus.add_service(self) def initialize(key) - @key = key.gsub(/[^0-9]/, '') + @key = key.strip + raise NotMyKey.new('invalid key format') unless @key =~ /\A[0-9]+\Z/ @time, @state = check end def finish? return !!(@state =~ /営業所へお問い合わせ下さい。|配達は終了致しました。$|^配達完了|引渡完了/)