Class: Daimyo::List
Instance Method Summary collapse
-
#initialize ⇒ List
constructor
A new instance of List.
- #output_table(wikis) ⇒ Object
- #run(project_id) ⇒ Object
Methods included from Helper
Constructor Details
Instance Method Details
#output_table(wikis) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/daimyo/list.rb', line 26 def output_table(wikis) table = Terminal::Table.new(:headings => ['ID', 'Name', 'Created', 'Updated'], :rows => wikis) puts table end |
#run(project_id) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/daimyo/list.rb', line 11 def run(project_id) wikis = [] res = @wiki.list(project_id) res.body.each do |w| wiki = [] wiki << w.id wiki << w.name wiki << w.created wiki << w.updated wikis << wiki end output_table(wikis) end |