Class: Vayacondios::Server::EventsHandler

Inherits:
DocumentHandler show all
Defined in:
lib/vayacondios/server/handlers/events_handler.rb

Overview

Handles requests against multiple Events.

Direct Known Subclasses

StreamHandler

Instance Attribute Summary

Attributes inherited from DocumentHandler

#database, #log

Instance Method Summary collapse

Methods inherited from DocumentHandler

#action_successful, #base_create, #base_delete, #base_search, #base_update, #call, #initialize

Constructor Details

This class inherits a constructor from Vayacondios::Server::DocumentHandler

Instance Method Details

#base_retrieve(params, query) ⇒ Object

FIXME Abstract this into method delegation



18
19
20
# File 'lib/vayacondios/server/handlers/events_handler.rb', line 18

def base_retrieve(params, query)
  base_search(params, query)
end

#delete(params, query) ⇒ Object



23
24
25
26
27
28
# File 'lib/vayacondios/server/handlers/events_handler.rb', line 23

def delete(params, query)
  Event.destroy(params, query) do |request, opts|
    database.call(:remove, request, opts)
  end
  action_successful
end

#search(params, query) ⇒ Object Also known as: retrieve

Search for events matching a given query.

Parameters:

  • params (Hash)

    routing information like ‘organization`, `topic,`, or `id`

  • query (Hash)

    the search query



10
11
12
13
14
# File 'lib/vayacondios/server/handlers/events_handler.rb', line 10

def search(params, query)
  Event.search(params, query) do |request, filter, opts|
    database.call(:search, request, filter, opts)
  end
end