Module: CodeLoader

Defined in:
lib/asker/loader/code_loader.rb

Class Method Summary collapse

Class Method Details

.call(xmldata, filepath) ⇒ Object

Load XML data about Code object

Parameters:

  • xmldata (XML Object)
  • filepath (String)

Returns:

  • Code object



13
14
15
16
17
18
# File 'lib/asker/loader/code_loader.rb', line 13

def self.call(xmldata, filepath)
  data = read_codedata_from_xml(xmldata, File.basename(filepath))
  code = Code.new(File.dirname(filepath), data[:path], data[:type])
  code.features = data[:features]
  code
end