Class: ProblemLoader
- Inherits:
-
Object
- Object
- ProblemLoader
- Defined in:
- lib/asker/loader/problem_loader.rb
Instance Method Summary collapse
-
#call(xmldata, filepath) ⇒ Object
Load XML data about Problem object.
-
#initialize(lang, context) ⇒ ProblemLoader
constructor
A new instance of ProblemLoader.
Constructor Details
#initialize(lang, context) ⇒ ProblemLoader
Returns a new instance of ProblemLoader.
8 9 10 11 |
# File 'lib/asker/loader/problem_loader.rb', line 8 def initialize(lang, context) @lang = lang @context = context end |
Instance Method Details
#call(xmldata, filepath) ⇒ Object
Load XML data about Problem object
18 19 20 21 22 23 24 |
# File 'lib/asker/loader/problem_loader.rb', line 18 def call(xmldata, filepath) data = read_problemdata_from_xml(xmldata, File.basename(filepath)) problem = Problem.from(data) problem.lang = @lang problem.context = @context problem end |