Class: Bl::Commands::Recent

Inherits:
Bl::Command show all
Defined in:
lib/bl/commands/recent.rb

Instance Method Summary collapse

Methods included from Printer

print_response, printable_issues

Methods included from Requestable

client, formatter, request

Constructor Details

#initializeRecent

Returns a new instance of Recent.



4
5
6
7
# File 'lib/bl/commands/recent.rb', line 4

def initialize(*)
  @config = Bl::Config.instance
  super
end

Instance Method Details

#issues(count = nil) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/bl/commands/recent.rb', line 10

def issues(count = nil)
  res = request(:get, 'users/myself/recentlyViewedIssues', count: count)
  res.body.each do |i|
    # TODO: print as table
    puts [i.issue.issueKey, i.issue.summary].join("\t")
  end
end

#wikis(count = nil) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/bl/commands/recent.rb', line 19

def wikis(count = nil)
  res = request(:get, 'users/myself/recentlyViewedWikis', count: count)
  res.body.each do |w|
    # TODO: print as table
    puts [w.page.id, w.page.name].join("\t")
  end
end