Class: Amiando::TicketShop

Inherits:
Resource show all
Defined in:
lib/amiando/ticket_shop.rb

Overview

From the documentation:

developers.amiando.com/index.php/REST_API_TicketShops

A ticketshop will automatically be created when you create an event.
That's why you only have read and update access, but no create access.
If you delete the related event, the ticketshop will also be deleted.

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(event_id) ⇒ TicketShop

Get the ticket shop of an event.

Parameters:

  • event

    id

Returns:



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

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

  object
end

.update(event_id, attributes) ⇒ Boolean

Updates the ticket shop.

Parameters:

  • event_id
  • attributes (Hash)

Returns:

  • (Boolean)

    deferred object indicating the result of the update.



33
34
35
36
37
38
# File 'lib/amiando/ticket_shop.rb', line 33

def self.update(event_id, attributes)
  object = Boolean.new('success')
  post object, "/api/event/#{event_id}/ticketShop", :params => attributes

  object
end