class RomLoader::GameRom
The class whose instances represent an individual game rom (e.g. Chrono Trigger object)
Attributes
download_url[R]
file_ext[R]
filename[R]
name[RW]
rom_detail_url[R]
size[R]
system[RW]
Public Class Methods
create_collection(game_array)
click to toggle source
Creates an array of GameRom
objects from an array
# File lib/romloader/game_rom.rb, line 17 def self.create_collection(game_array) game_array.collect {|game_details| self.new(game_details)} end
new(name:, rom_detail_url:)
click to toggle source
Create individual game rom objects from information scraped from freeroms.com, then sets the required name and rom_detail_url
instance variables
# File lib/romloader/game_rom.rb, line 11 def initialize(name:, rom_detail_url:) @name = name @rom_detail_url = rom_detail_url end
Public Instance Methods
set_rom_details(download_url: nil, size: nil, file_ext: nil, filename: nil)
click to toggle source
Sets all additional, optional rom details
# File lib/romloader/game_rom.rb, line 22 def set_rom_details(download_url: nil, size: nil, file_ext: nil, filename: nil) @download_url = download_url @size = size @file_ext = file_ext @filename = filename nil end