Module: AppParser::AppIcon
Instance Method Summary collapse
Instance Method Details
#icon(dimensions:) ⇒ Object
2 3 4 5 |
# 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 ⇒ Object
7 8 9 |
# File 'lib/app_parser/app_icon.rb', line 7 def largest_icon sorted_icons.last end |
#smallest_icon ⇒ Object
11 12 13 |
# File 'lib/app_parser/app_icon.rb', line 11 def smallest_icon sorted_icons.first end |
#sorted_icons ⇒ Object
15 16 17 |
# File 'lib/app_parser/app_icon.rb', line 15 def sorted_icons icons.sort_by { |icon| icon[:dimensions].first * icon[:dimensions].last } end |