Class: Zend::Command::Ticket::Show
- Defined in:
- lib/zend/command/ticket/show.rb
Instance Attribute Summary collapse
-
#ticket ⇒ Object
readonly
Returns the value of attribute ticket.
Instance Method Summary collapse
-
#initialize(id) ⇒ Show
constructor
A new instance of Show.
- #output ⇒ Object
- #table ⇒ Object
- #tabular_data ⇒ Object
Methods inherited from Base
#api, #is_num?, #terminal_width, #truncate
Constructor Details
#initialize(id) ⇒ Show
Returns a new instance of Show.
6 7 8 9 10 |
# File 'lib/zend/command/ticket/show.rb', line 6 def initialize(id) @ticket = remote_ticket(id) puts(output) end |
Instance Attribute Details
#ticket ⇒ Object (readonly)
Returns the value of attribute ticket.
4 5 6 |
# File 'lib/zend/command/ticket/show.rb', line 4 def ticket @ticket end |
Instance Method Details
#output ⇒ Object
12 13 14 |
# File 'lib/zend/command/ticket/show.rb', line 12 def output table.to_s + ticket.description end |
#table ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/zend/command/ticket/show.rb', line 16 def table Terminal::Table.new( style: { width: terminal_width, padding_left: 3 }, rows: tabular_data ) end |
#tabular_data ⇒ Object
26 27 28 29 30 31 |
# File 'lib/zend/command/ticket/show.rb', line 26 def tabular_data rows = Array.new rows << [value: col_subject, colspan: 3] rows << :separator rows << [col_requester, col_created, col_updated] end |