Class: Bl::Recent

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

Constant Summary

Constants inherited from Command

Command::ACTIVITY_TYPES, Command::CATEGORY_FIELDS, Command::FILE_FIELDS, Command::GIT_REPO_FIELDS, Command::ISSUES_PARAMS, Command::ISSUE_BASE_ATTRIBUTES, Command::ISSUE_FIELDS, Command::MILESTONE_FIELDS, Command::MILESTONE_PARAMS, Command::PROJECT_FIELDS, Command::PROJECT_PARAMS, Command::ROLES, Command::SPACE_DISK_USAGE, Command::SPACE_DISK_USAGE_DETAILS_FIELDS, Command::SPACE_FIELDS, Command::SPACE_NOTIFICATION_FIELDS, Command::TYPE_COLORS, Command::USER_FIELDS, Command::USER_PARAMS, Command::WATCHINGS_PARAMS, Command::WEBHOOK_FIELDS, Command::WEBHOOK_PARAMS, Command::WIKI_FIELDS

Instance Method Summary collapse

Methods included from Formatting

colorize_priority, colorize_status, colorize_type

Methods included from Requestable

client, formatter

Constructor Details

#initializeRecent

Returns a new instance of Recent.



4
5
6
7
# File 'lib/bl/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
17
# File 'lib/bl/recent.rb', line 10

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

#wikis(count = nil) ⇒ Object



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

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