class Serf::Handler::Event

Attributes

name[RW]
payload[RW]
type[RW]

Public Class Methods

new(cli = {}) click to toggle source
# File lib/serf/handler/event.rb, line 6
def initialize(cli = {})
  @type = cli[:type] || ENV['SERF_EVENT']&.to_sym || :query
  @type = :event if @type == :user
  @name = cli[:name] || ( @type == :query ? ENV['SERF_QUERY_NAME'] : ENV['SERF_USER_EVENT'] )
  @payload = cli[:payload] || STDIN.read
  @payload.strip!
end