Method: N65::INESHeader.parse

Defined in:
lib/n65/directives/ines_header.rb

.parse(line) ⇒ Object

Implementation of the parser for this directive



15
16
17
18
19
20
21
# File 'lib/n65/directives/ines_header.rb', line 15

def self.parse(line)
  match_data = line.match(/^\.ines (.+)$/)
  return nil if match_data.nil?

  header = JSON.parse(match_data[1])
  INESHeader.new(header['prog'], header['char'], header['mapper'], header['mirror'])
end