class Bl::Commands::Notification

Public Class Methods

new(*) click to toggle source

TODO:

Calls superclass method
# File lib/bl/commands/notification.rb, line 6
def initialize(*)
  @config = Bl::Config.instance
  @url = 'notifications'
  super
end

Public Instance Methods

count() click to toggle source
# File lib/bl/commands/notification.rb, line 21
def count
  # puts request(:get, "#{@url}/count").body.count
  # TODO fix nil error
end
list() click to toggle source
# 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() click to toggle source
# 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) click to toggle source
# 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