Class: Billingrails::Resources::Events

Inherits:
Object
  • Object
show all
Defined in:
lib/billingrails/resources/events.rb

Overview

Events resource

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Events

Returns a new instance of Events.

Parameters:

  • client (Client)

    The API client



10
11
12
# File 'lib/billingrails/resources/events.rb', line 10

def initialize(client)
  @client = client
end

Instance Method Details

#ingest(data) ⇒ Hash

Ingest event

Ingests an event.

Parameters:

  • data (Hash)

    Request body

Returns:

  • (Hash)

    Response data



20
21
22
23
# File 'lib/billingrails/resources/events.rb', line 20

def ingest(data)
  path = "/biller/events/ingest"
  @client.request(:post, path, body: data)
end

#ingest_batch(data) ⇒ Hash

Ingest batch events

Ingests batch events.

Parameters:

  • data (Hash)

    Request body

Returns:

  • (Hash)

    Response data



31
32
33
34
# File 'lib/billingrails/resources/events.rb', line 31

def ingest_batch(data)
  path = "/biller/events/batch"
  @client.request(:post, path, body: data)
end