module TicketMaster::Provider::Bugherd

This is the Bugherd Provider for ticketmaster

Constants

PROJECT_API

TICKET_API = Bugherd::Ticket # The class to access the api's tickets

Public Class Methods

new(auth = {}) click to toggle source

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

# File lib/provider/bugherd.rb, line 9
def self.new(auth = {})
  TicketMaster.new(:bugherd, auth)
end

Public Instance Methods

authorize(auth = {}) click to toggle source

Providers must define an authorize method. This is used to initialize and set authentication parameters to access the API

# File lib/provider/bugherd.rb, line 15
def authorize(auth = {})
  @authentication ||= TicketMaster::Authenticator.new(auth)
  auth = @authentication
  if (auth.email.empty? || auth.password.empty?)
    raise "You must provide email and password for authentication"
  end
  BugherdAPI.authenticate(auth.email, auth.password)
  # Set authentication parameters for whatever you're using to access the API
end
valid?() click to toggle source

declare needed overloaded methods here

# File lib/provider/bugherd.rb, line 26
def valid?
  begin 
    !BugherdAPI::User.find(:first).nil?
  rescue
    false
  end
end