Module: TicketMaster::Provider::Codaset

Includes:
Base
Defined in:
lib/provider/codaset.rb,
lib/provider/project.rb,
lib/provider/comment.rb,
lib/provider/ticket.rb

Overview

This is the Codaset Provider for ticketmaster

Defined Under Namespace

Classes: Comment, Project, Ticket

Constant Summary collapse

TICKET_API =

The class to access the api’s tickets

CodasetAPI::Ticket
PROJECT_API =

The class to access the api’s projects

CodasetAPI::Project
API =

Ticket class for ticketmaster-codaset

CodasetAPI::Ticket

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new(auth = {}) ⇒ Object

This is for cases when you want to instantiate using TicketMaster::Provider::Codaset.new(auth)



9
10
11
# File 'lib/provider/codaset.rb', line 9

def self.new(auth = {})
  TicketMaster.new(:codaset, auth)
end

Instance Method Details

#authorize(auth = {}) ⇒ Object

Client Id and Client Secret: get these values once you register your app on api.codaset.com/apps



17
18
19
20
21
22
23
24
25
# File 'lib/provider/codaset.rb', line 17

def authorize(auth = {})
  @authentication ||= TicketMaster::Authenticator.new(auth)
  auth = @authentication
  if auth.username.nil? or auth.password.nil? or auth.client_id.nil? or auth.client_secret.nil?
    raise "Please provide username, password, client id and client secret"
  end
  CodasetAPI. = auth.username
  CodasetAPI.authenticate(auth.username, auth.password, auth.client_id, auth.client_secret)
end

#valid?Boolean

declare needed overloaded methods here

Returns:

  • (Boolean)


29
30
31
32
33
34
35
36
# File 'lib/provider/codaset.rb', line 29

def valid?
  begin
    PROJECT_API.find(:first)
    true
  rescue
    false
  end
end