Sha256: ed57779e0aeba92550c9a72612ad1a065480c1cfcd6df2f23ba5e13f6137d641

Contents?: true

Size: 852 Bytes

Versions: 35

Compression:

Stored size: 852 Bytes

Contents

class OTRS::Ticket::Type < OTRS#::Ticket
  
  attr_accessor :id, :name
  def persisted?
    false
  end
  
  def initialize(attributes = {})
    attributes.each do |name, value|
      send("#{name.to_s.underscore.to_sym}=", value)
    end
  end
  
  def self.all
    data = { 'UserID' => 1 }
    params = { :object => 'TicketObject', :method => 'TicketTypeList', :data => data }
    a = connect(params)
    a = Hash[*a]
    b = []
    a.each do |key,value|
      c = {}
      c[key] = value
      b << c
    end
    c = self.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/type.rb
otrs_connector-1.5.1 lib/otrs_connector/otrs/ticket/type.rb
otrs_connector-1.5.0 lib/otrs_connector/otrs/ticket/type.rb
otrs_connector-1.4.0 lib/otrs_connector/otrs/ticket/type.rb
otrs_connector-1.3.0 lib/otrs_connector/otrs/ticket/type.rb
otrs_connector-1.2.0 lib/otrs_connector/otrs/ticket/type.rb
otrs_connector-1.1.3 lib/otrs_connector/otrs/ticket/type.rb
otrs_connector-1.1.2 lib/otrs_connector/otrs/ticket/type.rb
otrs_connector-1.1.1 lib/otrs_connector/otrs/ticket/type.rb
otrs_connector-1.1.0 lib/otrs_connector/otrs/ticket/type.rb
otrs_connector-1.0.4 lib/otrs_connector/otrs/ticket/type.rb
otrs_connector-1.0.3 lib/otrs_connector/otrs/ticket/type.rb
otrs_connector-1.0.2 lib/otrs_connector/otrs/ticket/type.rb
otrs_connector-1.0.1 lib/otrs_connector/otrs/ticket/type.rb
otrs_connector-1.0.0 lib/otrs_connector/otrs/ticket/type.rb
otrs_connector-0.5.20 lib/otrs_connector/otrs/ticket/type.rb
otrs_connector-0.5.19 lib/otrs_connector/ticket/type.rb
otrs_connector-0.5.18 lib/otrs_connector/ticket/type.rb
otrs_connector-0.5.17 lib/otrs_connector/ticket/type.rb
otrs_connector-0.5.16 lib/otrs_connector/ticket/type.rb