Class: Gdshowsdb::SongRefYAMLParser
- Inherits:
-
Object
- Object
- Gdshowsdb::SongRefYAMLParser
- Defined in:
- lib/gdshowsdb/song_ref_yaml_parser.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(song_ref_list) ⇒ SongRefYAMLParser
constructor
A new instance of SongRefYAMLParser.
- #parse ⇒ Object
Constructor Details
#initialize(song_ref_list) ⇒ SongRefYAMLParser
Returns a new instance of SongRefYAMLParser.
7 8 9 |
# File 'lib/gdshowsdb/song_ref_yaml_parser.rb', line 7 def initialize(song_ref_list) @song_ref_list = song_ref_list end |
Class Method Details
.from_yaml ⇒ Object
3 4 5 |
# File 'lib/gdshowsdb/song_ref_yaml_parser.rb', line 3 def self.from_yaml SongRefYAMLParser.new(Gdshowsdb.load_yaml('song_refs.yaml')) end |
Instance Method Details
#parse ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/gdshowsdb/song_ref_yaml_parser.rb', line 11 def parse @song_ref_list.map do |song_ref| key = song_ref.keys.first value = song_ref[key] { uuid: value, name: key } end end |