milestone_formatter.rb 578 字节
Newer Older
1 2 3 4 5
module Gitlab
  module GithubImport
    class MilestoneFormatter < BaseFormatter
      def attributes
        {
6
          iid: raw_data.number,
7
          project: project,
8 9 10
          title: raw_data.title,
          description: raw_data.description,
          due_date: raw_data.due_on,
11
          state: state,
12 13
          created_at: raw_data.created_at,
          updated_at: raw_data.updated_at
14 15 16
        }
      end

17 18
      def klass
        Milestone
19 20
      end

21 22 23 24 25 26 27 28
      private

      def state
        raw_data.state == 'closed' ? 'closed' : 'active'
      end
    end
  end
end