Sha256: 4dbe2ddeb134bb5ff1d0bdb8d4a6e421c2d5c2d78345cc201adf9a345bd2baa9

Contents?: true

Size: 999 Bytes

Versions: 35

Compression:

Stored size: 999 Bytes

Contents

class OTRS::Ticket::TicketQueue < OTRS::Ticket # Namespace conflict with OTRS::Ticket::Queue
  def self.set_accessor(key)
    attr_accessor key.to_sym
  end
  
  def persisted?
    false
  end
  
  def initialize(attributes = {})
    attributes.each do |name, value|
      self.class.set_accessor(name.to_s.underscore)
      send("#{name.to_s.underscore.to_sym}=", value)
    end
  end
  
  def self.all
    data = { 'UserID' => 1 }
    params = { :object => 'QueueObject', :method => 'QueueList', :data => data }
    a = connect(params)
    a = Hash[*a]
    b = []
    a.each do |key,value|
      c = {}
      c[key] = value
      b << c
    end
    c = self.superclass.superclass::Relation.new
    b.each do |d|
      d.each do |key,value|
        tmp = {}
        tmp[:id] = key
        tmp[:name] = value
        c << new(tmp)
      end
    end
    c
  end
  
  def self.all_name
    collection = []
    self.all.each do |s|
      collection << s.name
    end
    return collection
  end

  
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
otrs_connector-1.5.2 lib/otrs_connector/otrs/ticket/ticket_queue.rb
otrs_connector-1.5.1 lib/otrs_connector/otrs/ticket/ticket_queue.rb
otrs_connector-1.5.0 lib/otrs_connector/otrs/ticket/ticket_queue.rb
otrs_connector-1.4.0 lib/otrs_connector/otrs/ticket/ticket_queue.rb
otrs_connector-1.3.0 lib/otrs_connector/otrs/ticket/ticket_queue.rb
otrs_connector-1.2.0 lib/otrs_connector/otrs/ticket/ticket_queue.rb
otrs_connector-1.1.3 lib/otrs_connector/otrs/ticket/ticket_queue.rb
otrs_connector-1.1.2 lib/otrs_connector/otrs/ticket/ticket_queue.rb
otrs_connector-1.1.1 lib/otrs_connector/otrs/ticket/ticket_queue.rb
otrs_connector-1.1.0 lib/otrs_connector/otrs/ticket/ticket_queue.rb
otrs_connector-1.0.4 lib/otrs_connector/otrs/ticket/ticket_queue.rb
otrs_connector-1.0.3 lib/otrs_connector/otrs/ticket/ticket_queue.rb
otrs_connector-1.0.2 lib/otrs_connector/otrs/ticket/ticket_queue.rb
otrs_connector-1.0.1 lib/otrs_connector/otrs/ticket/ticket_queue.rb
otrs_connector-1.0.0 lib/otrs_connector/otrs/ticket/ticket_queue.rb
otrs_connector-0.5.20 lib/otrs_connector/otrs/ticket/ticket_queue.rb
otrs_connector-0.5.19 lib/otrs_connector/ticket/ticket_queue.rb
otrs_connector-0.5.18 lib/otrs_connector/ticket/ticket_queue.rb
otrs_connector-0.5.17 lib/otrs_connector/ticket/ticket_queue.rb
otrs_connector-0.5.16 lib/otrs_connector/ticket/ticket_queue.rb