Created
October 6, 2012 23:39
-
-
Save cadwallion/3846523 to your computer and use it in GitHub Desktop.
YAML Equipment config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'yaml' | |
equipment = YAML.load_file('equipment.yml') | |
weapons = equipment['weapons'] | |
armor = equipment['armor'] | |
puts weapons[1][1] # => { 'name' => 'Long Sword', 'damage' => 7 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
weapons: | |
1: | |
- name: 'Short Sword' | |
damage: 5 | |
- name: 'Long Sword' | |
damage: 7 | |
armor: | |
2: | |
- name: 'Leather Helm' | |
slot: 'head' | |
armor: 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment