Class: Levels::Input::JSON
- Inherits:
-
Object
- Object
- Levels::Input::JSON
- Defined in:
- lib/levels/input/json.rb
Overview
This input
Instance Method Summary collapse
-
#initialize(json_string) ⇒ JSON
constructor
A new instance of JSON.
- #read(level) ⇒ Object
Constructor Details
#initialize(json_string) ⇒ JSON
Returns a new instance of JSON.
6 7 8 |
# File 'lib/levels/input/json.rb', line 6 def initialize(json_string) @json = ::JSON.parse(json_string) end |
Instance Method Details
#read(level) ⇒ Object
10 11 12 13 14 |
# File 'lib/levels/input/json.rb', line 10 def read(level) @json.each do |group_name, group| level.set_group(group_name, group) end end |