Class: Levels::Input::YAML
- Inherits:
-
Object
- Object
- Levels::Input::YAML
- Defined in:
- lib/levels/input/yaml.rb
Instance Method Summary collapse
-
#initialize(yaml_string) ⇒ YAML
constructor
A new instance of YAML.
- #read(level) ⇒ Object
Constructor Details
#initialize(yaml_string) ⇒ YAML
Returns a new instance of YAML.
5 6 7 |
# File 'lib/levels/input/yaml.rb', line 5 def initialize(yaml_string) @yaml = ::YAML.load(yaml_string) end |
Instance Method Details
#read(level) ⇒ Object
9 10 11 12 13 |
# File 'lib/levels/input/yaml.rb', line 9 def read(level) @yaml.each do |group_name, group| level.set_group(group_name, group) end end |