Class: Parker::Platform::Switch

Inherits:
Base
  • Object
show all
Defined in:
lib/parker/platform/switch.rb

Overview

A class that models the Nintendo Switch platform.

Instance Attribute Summary

Attributes inherited from Base

#games, #name, #source_path

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Parker::Platform::Base

Instance Method Details

#scan_gamesObject



7
8
9
10
11
12
13
14
# File 'lib/parker/platform/switch.rb', line 7

def scan_games
  screenshot_path = File.join(source_path, '**', '*.jpg')

  Dir.glob(screenshot_path).each do |path|
    game_id = File.basename(path, File.extname(path)).split('-')[-1]
    (games[game_id].screenshots ||= {}) << Screenshot.new(path)
  end
end