Class: TicketReport::ViewTicket

Inherits:
Struct
  • Object
show all
Defined in:
app/interactors/ticket_report.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#antecedentsObject

Returns the value of attribute antecedents

Returns:

  • (Object)

    the current value of antecedents



3
4
5
# File 'app/interactors/ticket_report.rb', line 3

def antecedents
  @antecedents
end

#closed_atObject

Returns the value of attribute closed_at

Returns:

  • (Object)

    the current value of closed_at



3
4
5
# File 'app/interactors/ticket_report.rb', line 3

def closed_at
  @closed_at
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



3
4
5
# File 'app/interactors/ticket_report.rb', line 3

def id
  @id
end

#milestone_idObject

Returns the value of attribute milestone_id

Returns:

  • (Object)

    the current value of milestone_id



3
4
5
# File 'app/interactors/ticket_report.rb', line 3

def milestone_id
  @milestone_id
end

#milestone_nameObject

Returns the value of attribute milestone_name

Returns:

  • (Object)

    the current value of milestone_name



3
4
5
# File 'app/interactors/ticket_report.rb', line 3

def milestone_name
  @milestone_name
end

#numberObject

Returns the value of attribute number

Returns:

  • (Object)

    the current value of number



3
4
5
# File 'app/interactors/ticket_report.rb', line 3

def number
  @number
end

#opened_atObject

Returns the value of attribute opened_at

Returns:

  • (Object)

    the current value of opened_at



3
4
5
# File 'app/interactors/ticket_report.rb', line 3

def opened_at
  @opened_at
end

#reporter_emailObject

Returns the value of attribute reporter_email

Returns:

  • (Object)

    the current value of reporter_email



3
4
5
# File 'app/interactors/ticket_report.rb', line 3

def reporter_email
  @reporter_email
end

#reporter_first_nameObject

Returns the value of attribute reporter_first_name

Returns:

  • (Object)

    the current value of reporter_first_name



3
4
5
# File 'app/interactors/ticket_report.rb', line 3

def reporter_first_name
  @reporter_first_name
end

#reporter_last_nameObject

Returns the value of attribute reporter_last_name

Returns:

  • (Object)

    the current value of reporter_last_name



3
4
5
# File 'app/interactors/ticket_report.rb', line 3

def reporter_last_name
  @reporter_last_name
end

#summaryObject

Returns the value of attribute summary

Returns:

  • (Object)

    the current value of summary



3
4
5
# File 'app/interactors/ticket_report.rb', line 3

def summary
  @summary
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



3
4
5
# File 'app/interactors/ticket_report.rb', line 3

def type
  @type
end

Instance Method Details

#as_json(options = {}) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'app/interactors/ticket_report.rb', line 25

def as_json(options={})
  { id: id,
    number: number,
    type: type.downcase,
    summary: summary,
    reporter: {
      email: reporter_email,
      name: reporter_name },
    milestone: milestone_id && {
      id: milestone_id,
      name: milestone_name },
    antecedents: antecedents.map { |antecedent| { id: antecedent.id, kind: antecedent.kind } },
    openedAt: opened_at,
    closedAt: closed_at }
end

#reporter_nameObject



21
22
23
# File 'app/interactors/ticket_report.rb', line 21

def reporter_name
  "#{reporter_first_name} #{reporter_last_name}"
end