Class: Chiketto::Event

Inherits:
Resource show all
Defined in:
lib/chiketto/event.rb

Instance Attribute Summary collapse

Attributes inherited from Resource

#id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

endpoint, get, #initialize, query, token

Methods included from AttrDSL

included

Constructor Details

This class inherits a constructor from Chiketto::Resource

Instance Attribute Details

#capacityObject (readonly)

Returns the value of attribute capacity.



3
4
5
# File 'lib/chiketto/event.rb', line 3

def capacity
  @capacity
end

#categoriesObject (readonly)

Returns the value of attribute categories.



3
4
5
# File 'lib/chiketto/event.rb', line 3

def categories
  @categories
end

#resource_uriObject (readonly)

Returns the value of attribute resource_uri.



3
4
5
# File 'lib/chiketto/event.rb', line 3

def resource_uri
  @resource_uri
end

#statusObject (readonly)

Returns the value of attribute status.



3
4
5
# File 'lib/chiketto/event.rb', line 3

def status
  @status
end

#urlObject (readonly)

Returns the value of attribute url.



3
4
5
# File 'lib/chiketto/event.rb', line 3

def url
  @url
end

Class Method Details

.find(id) ⇒ Object



17
18
19
20
# File 'lib/chiketto/event.rb', line 17

def self.find(id)
  event = get "events/#{id}"
  Event.new event
end

.search(params = {}) ⇒ Object



22
23
24
25
# File 'lib/chiketto/event.rb', line 22

def self.search(params = {})
  events = get 'events/search', params
  events['events'].map { |event| Event.new event }
end

Instance Method Details

#attendees(params = {}) ⇒ Object



27
28
29
30
# File 'lib/chiketto/event.rb', line 27

def attendees(params = {})
  attendees = Chiketto::Event.find_attendees @id, params
  attendees['attendees'].map { |att| Attendee.new att }
end

#organizerObject



32
33
34
# File 'lib/chiketto/event.rb', line 32

def organizer
  Chiketto::Organizer.new @organizer.to_h
end

#ticket_classesObject



36
37
38
39
40
# File 'lib/chiketto/event.rb', line 36

def ticket_classes
  @ticket_classes.map do |t_class|
    Chiketto::TicketClass.new t_class.to_h
  end
end

#venueObject



42
43
44
# File 'lib/chiketto/event.rb', line 42

def venue
  Chiketto::Venue.new @venue.to_h
end