class XcodeResultBundleProcessor::TestSummaries::Activity

Public Class Methods

parse(activity_summary) click to toggle source
# File lib/xcoderesultbundleprocessor/test_summaries/test_summaries.rb, line 37
def self.parse(activity_summary)
  screenshot      = Array(activity_summary['Attachments']).find { |attachment| attachment['Name'] == 'Screenshot' }
  screenshot_path = nil
  unless screenshot.nil?
    screenshot_path = screenshot['FileName']
  end

  snapshot      = Array(activity_summary['Attachments']).find { |attachment| attachment['Name'] == 'Snapshot' }
  snapshot_path = nil
  unless snapshot.nil?
    snapshot_path = snapshot['FileName']
  end

  Activity.new(
      title:           activity_summary['Title'],
      screenshot_path: screenshot_path,
      snapshot_path:   snapshot_path,
      subactivities:   Array(activity_summary['SubActivities']).map { |subactivity| Activity.parse(subactivity) }
  )
end