7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/go_api_client/parsers/pipeline_parser.rb', line 7
def parse(root)
GoApiClient::Domain::Pipeline.new(
{
:name => root.attributes['name'].value,
:label => root.attributes['label'].value,
:counter => root.attributes['counter'].value.to_i,
:self_uri => href_from(root.xpath("./link[@rel='self']")),
:inserted_after_uri => href_from(root.xpath("./link[@rel='insertedAfter']")),
:id => root.xpath('./id').first.content,
:schedule_time => Time.parse(root.xpath('./scheduleTime').first.content).utc,
:approved_by => root.xpath('./approvedBy').first.content,
:stages => root.xpath('./stages/stage').collect do |element|
element.attributes['href'].value
end,
:parsed_materials => root.xpath('./materials/material').collect do |element|
GoApiClient::Parsers::Material.parse(element)
end
})
end
|