module AppParser::AppIcon
Public Instance Methods
icon(dimensions:)
click to toggle source
# File lib/app_parser/app_icon.rb, line 2 def icon(dimensions:) dimensions = [dimensions, dimensions] unless dimensions.is_a? Array icons.find { |icon| icon[:dimensions] == dimensions } end
largest_icon()
click to toggle source
# File lib/app_parser/app_icon.rb, line 7 def largest_icon sorted_icons.last end
smallest_icon()
click to toggle source
# File lib/app_parser/app_icon.rb, line 11 def smallest_icon sorted_icons.first end
sorted_icons()
click to toggle source
# File lib/app_parser/app_icon.rb, line 15 def sorted_icons icons.sort_by { |icon| icon[:dimensions].first * icon[:dimensions].last } end