2016-04-18 12:44:27 -04:00
|
|
|
module Gitlab
|
|
|
|
module GithubImport
|
|
|
|
class MilestoneFormatter < BaseFormatter
|
|
|
|
def attributes
|
|
|
|
{
|
|
|
|
iid: number,
|
|
|
|
project: project,
|
|
|
|
title: title,
|
|
|
|
description: description,
|
|
|
|
due_date: due_date,
|
|
|
|
state: state,
|
|
|
|
created_at: created_at,
|
|
|
|
updated_at: updated_at
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2016-06-06 13:00:44 -04:00
|
|
|
def klass
|
|
|
|
Milestone
|
2016-05-18 17:14:20 -04:00
|
|
|
end
|
|
|
|
|
2016-04-18 12:44:27 -04:00
|
|
|
private
|
|
|
|
|
|
|
|
def number
|
|
|
|
raw_data.number
|
|
|
|
end
|
|
|
|
|
|
|
|
def title
|
|
|
|
raw_data.title
|
|
|
|
end
|
|
|
|
|
|
|
|
def description
|
|
|
|
raw_data.description
|
|
|
|
end
|
|
|
|
|
|
|
|
def due_date
|
|
|
|
raw_data.due_on
|
|
|
|
end
|
|
|
|
|
|
|
|
def state
|
|
|
|
raw_data.state == 'closed' ? 'closed' : 'active'
|
|
|
|
end
|
|
|
|
|
|
|
|
def created_at
|
|
|
|
raw_data.created_at
|
|
|
|
end
|
|
|
|
|
|
|
|
def updated_at
|
|
|
|
state == 'closed' ? raw_data.closed_at : raw_data.updated_at
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|