Class: ConvertLoop::EventLog

Inherits:
Object
  • Object
show all
Defined in:
lib/convertloop/event_log.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ EventLog

Returns a new instance of EventLog.

Raises:

  • (RuntimeError)


3
4
5
6
# File 'lib/convertloop/event_log.rb', line 3

def initialize(client)
  raise RuntimeError, "No client provided" if client.nil?
  @client = client
end

Instance Method Details

#send(args = {}) ⇒ Object

Raises:

  • (ArgumentError)


8
9
10
11
12
13
# File 'lib/convertloop/event_log.rb', line 8

def send(args={})
  raise ArgumentError, "No args provided" if args.nil?
  raise ArgumentError, "No event name provided" if args[:name].nil? || args[:name].empty?

  @client.post("/event_logs", args)
end