Convert XML collection (of Pivotal Tracker stories) to Ruby hash/object

前端 未结 5 1462
北海茫月
北海茫月 2021-02-06 17:44

I have a collection of stories in an XML format. I would like to parse the file and return each story as either hash or Ruby object, so that I can further manipulate the data wi

5条回答
  •  灰色年华
    2021-02-06 18:09

    Maybe a Ruby interface to Pivotal API can be better solution for your task, see https://github.com/jsmestad/pivotal-tracker ... then you can get stories as plain Ruby objects like (from docs):

    @a_project = PivotalTracker::Project.find(84739)                              
    @a_project.stories.all(:label => 'overdue', :story_type => ['bug', 'chore'])
    

提交回复
热议问题