Class: PromptWarden::CLI::EventFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/prompt_warden/cli.rb

Class Method Summary collapse

Class Method Details

.matches?(event, options) ⇒ Boolean

Returns:

  • (Boolean)


52
53
54
55
56
57
58
# File 'lib/prompt_warden/cli.rb', line 52

def self.matches?(event, options)
  return false if options[:alerts] && (!event.alerts || event.alerts.empty?)
  return false if options[:model] && event.model != options[:model]
  return false if options[:cost] && (!event.cost_usd || event.cost_usd < options[:cost])
  return false if options[:status] && event.status != options[:status]
  true
end