Class: Ticketutils::SeatingChart

Inherits:
Base
  • Object
show all
Defined in:
lib/ticketutils/seating_chart.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/ticketutils/seating_chart.rb', line 3

def id
  @id
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/ticketutils/seating_chart.rb', line 3

def name
  @name
end

#statusObject

Returns the value of attribute status.



3
4
5
# File 'lib/ticketutils/seating_chart.rb', line 3

def status
  @status
end

#urlObject

Returns the value of attribute url.



3
4
5
# File 'lib/ticketutils/seating_chart.rb', line 3

def url
  @url
end

#url_largeObject

Returns the value of attribute url_large.



3
4
5
# File 'lib/ticketutils/seating_chart.rb', line 3

def url_large
  @url_large
end

#url_mediumObject

Returns the value of attribute url_medium.



3
4
5
# File 'lib/ticketutils/seating_chart.rb', line 3

def url_medium
  @url_medium
end

#venue_idObject

Returns the value of attribute venue_id.



3
4
5
# File 'lib/ticketutils/seating_chart.rb', line 3

def venue_id
  @venue_id
end

#versionObject

Returns the value of attribute version.



3
4
5
# File 'lib/ticketutils/seating_chart.rb', line 3

def version
  @version
end

Class Method Details

.find(options = {}) ⇒ Object

Ticketutils.seating_charts(options) => returns a will_paginate collection of seating charts options:

page: defaults to 1
  First page is 1, 100 results to the page
per_page: defaults to 100
  Paginate this many per page. Limit is 100.
updated: defaults to before the sevice was up
  Only show venues updated since this date.
venue_id: Only tickets for a specific venue


14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/ticketutils/seating_chart.rb', line 14

def self.find(options = {})
  results = if options[:venue_id]
    get("/#{Ticketutils.auth_token}/Charts/OfVenue/#{options[:venue_id]}").parsed_response
  elsif options[:updated]
    get("/#{Ticketutils.auth_token}/Charts/UpdatedSince/#{options[:updated].strftime("%Y%m%d%H%M")}/#{options[:page] || 1}").parsed_response
  else
    params = { :VenueId => options[:venue_id], 
               :page => options[:page] || 1,
               :itemsPerPage => options[:per_page] || 100,
               :updatedSince => options[:updated] }.collect { |k, v| "#{k}=#{v}" unless v.nil? }
    get("/#{Ticketutils.auth_token}/Charts?#{params.join("&")}").parsed_response
  end
  return parse_response(results)
end