Module: Imeister

Defined in:
lib/imeister.rb,
lib/imeister/version.rb,
lib/imeister/constants.rb,
lib/imeister/warranty_status.rb

Defined Under Namespace

Classes: WarrantyStatus

Constant Summary collapse

VERSION =
'0.1.0'
WARRANTY_URL =
'https://selfsolve.apple.com'
RESULTS_URL =
'/wcResults.do'
STATUS_REGEXP =
/(?:warrantyPage\.warrantycheck\.displayHWSupportInfo\()((?:\w)+)/i
EXPIRATION_DATE_REGEXP =
/(?:Estimated\ Expiration\ Date:\ )((?:[^<]*))/i
VALID_IMEI_REGEXP =
/^\d{15}*$/

Class Method Summary collapse

Class Method Details

.find(imei) ⇒ Object



6
7
8
9
# File 'lib/imeister.rb', line 6

def find(imei)
  return 'Invalid IMEI number' unless imei_valid?(imei)
  WarrantyStatus.new(imei)
end