Module: TicketMaster::Provider::Kanbanpad

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

Overview

This is the Kanbanpad Provider for ticketmaster

Defined Under Namespace

Classes: Comment, Project, Ticket

Constant Summary collapse

TICKET_API =
KanbanpadAPI::Task
PROJECT_API =
KanbanpadAPI::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::Kanbanpad.new(auth)



10
11
12
# File 'lib/provider/kanbanpad.rb', line 10

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

Instance Method Details

#authorize(auth = {}) ⇒ Object

The authorize and initializer for this provider



15
16
17
18
19
20
21
22
# File 'lib/provider/kanbanpad.rb', line 15

def authorize(auth = {})
  @authentication ||= TicketMaster::Authenticator.new(auth)
  auth = @authentication
  if (auth.username.blank? and auth.email.blank?) and (auth.token.blank? and auth.password.blank?)
    raise "Please provide at least a set of username and password)"
  end
  KanbanpadAPI.authenticate((auth.username.blank? ? auth.email : auth.username), (auth.password.blank? ? auth.token : auth.password))
end

#valid?Boolean

Returns:

  • (Boolean)


24
25
26
27
28
29
30
31
# File 'lib/provider/kanbanpad.rb', line 24

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