Class: Amiando::Public::Event

Inherits:
Resource
  • Object
show all
Defined in:
lib/amiando/public/event.rb

Instance Attribute Summary

Attributes inherited from Resource

#request, #response, #success

Class Method Summary collapse

Methods inherited from Resource

#==, #extract_attributes_from, #initialize, method_missing, #populate_create

Methods included from Attributes

#[], #id, included, #method_missing, #respond_to?, #type

Methods included from Autorun

included

Constructor Details

This class inherits a constructor from Amiando::Resource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Amiando::Attributes

Class Method Details

.find(id) ⇒ Public::Event

Query the public api. See the documentation [missing] for possible filter parameters.

Parameters:

  • id

Returns:



34
35
36
37
38
39
# File 'lib/amiando/public/event.rb', line 34

def self.find(id)
  object = new
  get object, "/api/public/event/#{id}"

  object
end

.search(options = {}) ⇒ Result

Query the public api.

Possible filter parameters are:

  • start_date

  • end_date

  • language

  • offset

Parameters:

  • options (Hash) (defaults to: {})

Returns:

  • (Result)

    with a list of event ids (up to 100 per request)



19
20
21
22
23
24
25
# File 'lib/amiando/public/event.rb', line 19

def self.search(options = {})
  object = Result.new do |response_body|
    response_body['ids']
  end
  get object, '/api/public/event/findPublic', :params => options
  object
end