2016-06-02 11:05:42 +05:30
|
|
|
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-16 23:09:34 +05:30
|
|
|
def klass
|
|
|
|
Milestone
|
|
|
|
end
|
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
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
|