Class: Convoy::Event

Inherits:
ApiResource show all
Extended by:
ApiOperations::Create
Includes:
ApiOperations::Delete, ApiOperations::Get, ApiOperations::List, ApiOperations::Save
Defined in:
lib/convoy/resources/event.rb

Instance Attribute Summary

Attributes inherited from ApiResource

#response

Instance Method Summary collapse

Methods included from ApiOperations::Create

create

Methods included from ApiOperations::List

included, #list

Methods included from ApiOperations::Delete

#delete, included

Methods included from ApiOperations::Save

included, #save, #update

Methods included from ApiOperations::Get

#get, included

Methods inherited from ApiResource

#project_base_uri

Methods included from ApiOperations::Request

#send_request

Constructor Details

#initialize(id = nil, config = Convoy.config, **kwargs) ⇒ Event

Returns a new instance of Event.



9
10
11
12
13
14
# File 'lib/convoy/resources/event.rb', line 9

def initialize(id = nil , config = Convoy.config, **kwargs)
  @id = id
  @config = config

  super(**kwargs)
end

Instance Method Details

#fanoutObject



24
25
26
27
# File 'lib/convoy/resources/event.rb', line 24

def fanout
  fanout_uri = "#{resource_uri}/fanout"
  send_request(fanout_uri, :post, data: @data, params: @params)
end

#resource_uriObject



16
17
18
19
20
21
22
# File 'lib/convoy/resources/event.rb', line 16

def resource_uri
  if @id.nil?
    return "#{project_base_uri}/events"
  end

  "#{project_base_uri}/events/#{@id}"
end