Class: Zend::Command::Ticket

Inherits:
Base
  • Object
show all
Defined in:
lib/zend/command/ticket.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#api, #terminal_width

Constructor Details

#initialize(ticket_id) ⇒ Ticket

Returns a new instance of Ticket.



6
7
8
# File 'lib/zend/command/ticket.rb', line 6

def initialize(ticket_id)
  @ticket = api.tickets.find(id: ticket_id, include: :users)
end

Instance Attribute Details

#ticketObject (readonly)

Returns the value of attribute ticket.



4
5
6
# File 'lib/zend/command/ticket.rb', line 4

def ticket
  @ticket
end

Instance Method Details



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/zend/command/ticket.rb', line 10

def print
  rows = Array.new
  rows << [value: col_subject, colspan: 3]
  rows << :separator
  rows << [col_requester, col_created, col_updated]

  puts Terminal::Table.new(
    style: {
      width: terminal_width,
      padding_left: 3
    },
    rows: rows
  )

  puts col_description
end