Class: Bl::Commands::Notification
Instance Method Summary
collapse
Methods included from Printer
print_response, printable_issues
client, formatter, request
Constructor Details
6
7
8
9
10
|
# File 'lib/bl/commands/notification.rb', line 6
def initialize(*)
@config = Bl::Config.instance
@url = 'notifications'
super
end
|
Instance Method Details
#count ⇒ Object
21
22
23
24
|
# File 'lib/bl/commands/notification.rb', line 21
def count
end
|
#list ⇒ Object
14
15
16
17
|
# File 'lib/bl/commands/notification.rb', line 14
def list
res = request(:get, @url, options.to_h)
res.body.map { |n| puts n.pretty_inspect }
end
|
#mark_as_read ⇒ Object
27
28
29
30
31
|
# File 'lib/bl/commands/notification.rb', line 27
def mark_as_read
res = request(:post, "#{@url}/markAsRead")
puts 'notifications mark as readed'
puts res.body.count
end
|
#read(id) ⇒ Object
34
35
36
37
38
|
# File 'lib/bl/commands/notification.rb', line 34
def read(id)
res = request(:post, "#{@url}/#{id}/markAsRead")
puts "notifications #{id} readed"
puts res.pretty_inspect
end
|