Class: Bl::Watchings
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
client, formatter
Constructor Details
Returns a new instance of Watchings.
4
5
6
7
8
|
# File 'lib/bl/watchings.rb', line 4
def initialize(*)
@config = Bl::Config.instance
@url = 'watchings'
super
end
|
Instance Method Details
#add ⇒ Object
32
33
34
35
36
|
# File 'lib/bl/watchings.rb', line 32
def add
res = client.post('watchings', options.to_h)
puts 'watch added'
print_watch_target(res.body)
end
|
#count(id) ⇒ Object
19
20
21
22
|
# File 'lib/bl/watchings.rb', line 19
def count(id)
res = client.get("/users/#{id}/#{@url}/count")
puts res.body.count
end
|
#delete(id) ⇒ Object
48
49
50
51
52
|
# File 'lib/bl/watchings.rb', line 48
def delete(id)
res = client.delete("watchings/#{id}")
puts 'watch deleted'
print_watch_target(res.body)
end
|
#list(id) ⇒ Object
12
13
14
15
|
# File 'lib/bl/watchings.rb', line 12
def list(id)
res = client.get("/users/#{id}/#{@url}", delete_class_options(options.to_h))
res.body.map { |t| print_watch_target(t) }
end
|
#mark_as_checked(id) ⇒ Object
61
62
63
64
|
# File 'lib/bl/watchings.rb', line 61
def mark_as_checked(id)
res = client.post("/users/#{id}/watchings/markAsChecked")
puts 'watch mark as checked'
end
|
#mark_as_read(id) ⇒ Object
55
56
57
58
|
# File 'lib/bl/watchings.rb', line 55
def mark_as_read(id)
res = client.post("watchings/#{id}/markAsRead")
puts 'watch mark as read'
end
|
#show(id) ⇒ Object
25
26
27
28
|
# File 'lib/bl/watchings.rb', line 25
def show(id)
res = client.get("watchings/#{id}")
print_watch_target(res.body)
end
|
#update(id) ⇒ Object
40
41
42
43
44
45
|
# File 'lib/bl/watchings.rb', line 40
def update(id)
end
|