Class: Levels::Input::YAML

Inherits:
Object
  • Object
show all
Defined in:
lib/levels/input/yaml.rb

Instance Method Summary collapse

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