Class: AppStoreInfo::App
Instance Attribute Summary collapse
Instance Method Summary
collapse
included, #read_json_accessors
Constructor Details
#initialize(json) ⇒ App
18
19
20
21
22
23
24
|
# File 'lib/appstore_info/app.rb', line 18
def initialize(json)
read_json_accessors(json)
@artwork = json['artworkUrl512'] || json['artworkUrl100']
@current_version = read_current_version(json)
end
|
Instance Attribute Details
#current_version ⇒ Object
Returns the value of attribute current_version.
8
9
10
|
# File 'lib/appstore_info/app.rb', line 8
def current_version
@current_version
end
|
Instance Method Details
#genre_names ⇒ Object
30
31
32
|
# File 'lib/appstore_info/app.rb', line 30
def genre_names
@genre_ids.map { |genre| AppStoreInfo::GENRES[genre.to_i] }
end
|
#store_icon_url ⇒ Object
34
35
36
37
38
|
# File 'lib/appstore_info/app.rb', line 34
def store_icon_url
return unless @artwork
@artwork =~ /\.(png|jpg|gif)\z/ ? @artwork : nil
end
|
#universal? ⇒ Boolean
26
27
28
|
# File 'lib/appstore_info/app.rb', line 26
def universal?
@features.include?('iosUniversal')
end
|