Module: TicketMaster::Provider::Mingle
- Includes:
- Base
- Defined in:
- lib/provider/mingle.rb,
lib/provider/project.rb,
lib/provider/comment.rb,
lib/provider/ticket.rb
Overview
This is the Mingle Provider for ticketmaster
Defined Under Namespace
Classes: Comment, Project, Ticket
Constant Summary collapse
- API =
Ticket class for ticketmaster-mingle
MingleAPI::Card
- TICKET_API =
The class to access the api’s cards
MingleAPI::Card
- PROJECT_API =
The class to access the api’s projects
MingleAPI::Project
Class Method Summary collapse
-
.new(auth = {}) ⇒ Object
This is for cases when you want to instantiate using TicketMaster::Provider::Mingle.new(auth).
Instance Method Summary collapse
-
#authorize(auth = {}) ⇒ Object
Providers must define an authorize method.
-
#valid? ⇒ Boolean
declare needed overloaded methods here.
Class Method Details
.new(auth = {}) ⇒ Object
This is for cases when you want to instantiate using TicketMaster::Provider::Mingle.new(auth)
9 10 11 |
# File 'lib/provider/mingle.rb', line 9 def self.new(auth = {}) TicketMaster.new(:mingle, 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
16 17 18 19 20 21 22 23 |
# File 'lib/provider/mingle.rb', line 16 def (auth = {}) @authentication ||= TicketMaster::Authenticator.new(auth) auth = @authentication if auth.server.blank? and auth.login.blank? and auth.password.blank? raise "Please provide server, login and password" end MingleAPI.authenticate(auth.server, auth.login, auth.password) end |
#valid? ⇒ Boolean
declare needed overloaded methods here
25 26 27 28 29 30 31 32 |
# File 'lib/provider/mingle.rb', line 25 def valid? begin PROJECT_API.find(:first) true rescue false end end |