Class: StoreApi::AppStore::Apps::Details

Inherits:
Object
  • Object
show all
Includes:
Request
Defined in:
lib/store_api/app_store/apps/details.rb

Overview

app store detail class

Constant Summary collapse

@@path =
'/lookup'

Constants included from Request

Request::TIME_OUT

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Request

#get, #post, #request

Constructor Details

#initialize(id, country = nil, proxy = nil, header = nil) ⇒ Details

initialize

Parameters:

  • id (String)
  • lang (String)
  • proxy (Hash) (defaults to: nil)
  • header (Hash) (defaults to: nil)


25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/store_api/app_store/apps/details.rb', line 25

def initialize(id, country=nil, proxy=nil, header=nil)
  params = {'id' => id, 'country' => country, 'entry' => 'software' }
  begin
    html = get(StoreApi::AppStore::HOST, @@path, params, StoreApi::AppStore::HTTPS, proxy, header)
    @raw_details = JSON.load(html)['results'][0]
    @id = @raw_details['trackId']
    @title = @raw_details['trackName']
    @cover_image = @raw_details['artworkUrl60']
    @developer = @raw_details['sellerName']
    @developer_url = @raw_details['artistViewUrl']
    @category = @raw_details['primaryGenreName']
    @categories = @raw_details['genres']
    @category_id = @raw_details['primaryGenreId']
    @category_ids = @raw_details['genreIds']
    @price = @raw_details['price']
    @screenshot = @raw_details['screenshotUrls']
    @description = @raw_details['description']
    @rating_value = @raw_details['averageUserRating']
    @rating_count = @raw_details['userRatingCount']
    @rating_score = @raw_details['averageUserRating']
    @release_notes = @raw_details['releaseNotes']
    @date_published = @raw_details['releaseDate']
    @file_size = @raw_details['fileSizeBytes']
    @software_version = @raw_details['version']
    @content_rating = @raw_details['contentAdvisoryRating']
    @supported_devices = @raw_details['supportedDevices']
    @bundle_id = @raw_details['bundleId']
  rescue => e
    puts e
  end
end

Instance Attribute Details

#bundle_idObject

Returns the value of attribute bundle_id.



11
12
13
# File 'lib/store_api/app_store/apps/details.rb', line 11

def bundle_id
  @bundle_id
end

#categoriesObject

Returns the value of attribute categories.



11
12
13
# File 'lib/store_api/app_store/apps/details.rb', line 11

def categories
  @categories
end

#categoryObject

Returns the value of attribute category.



11
12
13
# File 'lib/store_api/app_store/apps/details.rb', line 11

def category
  @category
end

#category_idObject

Returns the value of attribute category_id.



11
12
13
# File 'lib/store_api/app_store/apps/details.rb', line 11

def category_id
  @category_id
end

#category_idsObject

Returns the value of attribute category_ids.



11
12
13
# File 'lib/store_api/app_store/apps/details.rb', line 11

def category_ids
  @category_ids
end

#content_ratingObject

Returns the value of attribute content_rating.



11
12
13
# File 'lib/store_api/app_store/apps/details.rb', line 11

def content_rating
  @content_rating
end

#cover_imageObject

Returns the value of attribute cover_image.



11
12
13
# File 'lib/store_api/app_store/apps/details.rb', line 11

def cover_image
  @cover_image
end

#date_publishedObject

Returns the value of attribute date_published.



11
12
13
# File 'lib/store_api/app_store/apps/details.rb', line 11

def date_published
  @date_published
end

#descriptionObject

Returns the value of attribute description.



11
12
13
# File 'lib/store_api/app_store/apps/details.rb', line 11

def description
  @description
end

#developerObject

Returns the value of attribute developer.



11
12
13
# File 'lib/store_api/app_store/apps/details.rb', line 11

def developer
  @developer
end

#developer_urlObject

Returns the value of attribute developer_url.



11
12
13
# File 'lib/store_api/app_store/apps/details.rb', line 11

def developer_url
  @developer_url
end

#file_sizeObject

Returns the value of attribute file_size.



11
12
13
# File 'lib/store_api/app_store/apps/details.rb', line 11

def file_size
  @file_size
end

#idObject

Returns the value of attribute id.



11
12
13
# File 'lib/store_api/app_store/apps/details.rb', line 11

def id
  @id
end

#priceObject

Returns the value of attribute price.



11
12
13
# File 'lib/store_api/app_store/apps/details.rb', line 11

def price
  @price
end

#rating_countObject

Returns the value of attribute rating_count.



11
12
13
# File 'lib/store_api/app_store/apps/details.rb', line 11

def rating_count
  @rating_count
end

#rating_scoreObject

Returns the value of attribute rating_score.



11
12
13
# File 'lib/store_api/app_store/apps/details.rb', line 11

def rating_score
  @rating_score
end

#rating_valueObject

Returns the value of attribute rating_value.



11
12
13
# File 'lib/store_api/app_store/apps/details.rb', line 11

def rating_value
  @rating_value
end

#release_notesObject

Returns the value of attribute release_notes.



11
12
13
# File 'lib/store_api/app_store/apps/details.rb', line 11

def release_notes
  @release_notes
end

#screenshotObject

Returns the value of attribute screenshot.



11
12
13
# File 'lib/store_api/app_store/apps/details.rb', line 11

def screenshot
  @screenshot
end

#software_versionObject

Returns the value of attribute software_version.



11
12
13
# File 'lib/store_api/app_store/apps/details.rb', line 11

def software_version
  @software_version
end

#supported_devicesObject

Returns the value of attribute supported_devices.



11
12
13
# File 'lib/store_api/app_store/apps/details.rb', line 11

def supported_devices
  @supported_devices
end

#titleObject

Returns the value of attribute title.



11
12
13
# File 'lib/store_api/app_store/apps/details.rb', line 11

def title
  @title
end

Instance Method Details

#raw_detailsHash

get raw details

Returns:

  • (Hash)


60
61
62
# File 'lib/store_api/app_store/apps/details.rb', line 60

def raw_details
  @raw_details
end