Sha256: f445e61dd37a982b46e584b09f6f836734032b07bdd8f22dc118734de6535a95

Contents?: true

Size: 690 Bytes

Versions: 2

Compression:

Stored size: 690 Bytes

Contents

module TicketMasterMod
  class Ticket < Hashie::Mash
    def create
      TicketMasterMod.const_get((self.system || self.project.system).to_s.capitalize)::Ticket.create(self)
    end

    def close(resolution = {})
      TicketMasterMod.const_get(self.system.to_s.capitalize)::Ticket.close(self, resolution)
    end

    def save
      TicketMasterMod.const_get(self.system.to_s.capitalize)::Ticket.save(self)
    end

    class Creator
      def initialize(system)
        @system = {:project => system}
      end

      def create(ticket_hash)
        ticket_hash.merge!(@system)
        ticket = TicketMasterMod::Ticket.new(ticket_hash)
        ticket.create
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ticketmaster-0.0.1 lib/ticketmaster/ticket.rb
ticketmaster-0.0.0 lib/ticketmaster/ticket.rb