module TicketMaster::Provider::Rally

This is the Rally Provider for ticketmaster

Public Class Methods

new(auth = {}) click to toggle source

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

# File lib/provider/rally.rb, line 7
def self.new(auth = {})
  TicketMaster.new(:rally, auth)
end
rally() click to toggle source
# File lib/provider/rally.rb, line 40
def self.rally
  @rally
end
rally=(rally_instance) click to toggle source
# File lib/provider/rally.rb, line 36
def self.rally=(rally_instance)
  @rally = rally_instance
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/rally.rb, line 13
def authorize(auth = {})
  @authentication ||= TicketMaster::Authenticator.new(auth)
  auth = @authentication
  if ((auth.url.nil? || auth.url.empty?) and (auth.username.nil? || auth.username.empty?) and (auth.password.nil? || auth.password.empty?))
    raise "Please you should provide a Rally url, username and password"
  end
  TicketMaster::Provider::Rally.rally = RallyRestAPI.new(:username => auth.username, 
                                                         :password => auth.password,
                                                         :base_url => auth.url)
                                                         
end
valid?() click to toggle source

declare needed overloaded methods here

# File lib/provider/rally.rb, line 27
def valid?
  begin
    TicketMaster::Provider::Rally.rally.find_all(:project).first
    true
  rescue
    false
  end
end