Method: AppStoreInfo.read

Defined in:
lib/appstore_info.rb

.read(id, region = DEFAULT_REGION) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/appstore_info.rb', line 10

def self.read(id, region = DEFAULT_REGION)
  # The region can be wrong because of the multiple app store formats (and our way of  getting) it
  # from the URL. If that's the case then just fallback to 'us'.
  region = DEFAULT_REGION unless Regions.find(region)

  json = AppStoreInfo::API.new(id, region).parse

  App.new(json)
end