Module: TicketMaster::Provider::Bugherd

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

Overview

This is the Bugherd Provider for ticketmaster

Defined Under Namespace

Classes: Comment, Project, Ticket

Constant Summary collapse

PROJECT_API =

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

BugherdAPI::Project

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::Bugherd.new(auth)



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

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

Instance Method Details

#authorize(auth = {}) ⇒ Object

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



15
16
17
18
19
20
21
22
23
# 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?Boolean

declare needed overloaded methods here

Returns:

  • (Boolean)


26
27
28
29
30
31
32
# File 'lib/provider/bugherd.rb', line 26

def valid?
  begin 
    !BugherdAPI::User.find(:first).nil?
  rescue
    false
  end
end