class Gamerom::GameInfo
GameInfo
- Extracts region and tags from game name
Constants
- REGIONS
- TAGS
Attributes
name[R]
Public Class Methods
new(name)
click to toggle source
# File lib/gamerom/game_info.rb, line 69 def initialize(name) @name = name end
Public Instance Methods
region()
click to toggle source
# File lib/gamerom/game_info.rb, line 73 def region identifiers = @name.scan(/\((?<region>[A-Za-z0-9]+)\)/).flatten region_id = identifiers.find { |i| REGIONS.include? i } if region_id REGIONS[region_id] else 'USA' end end