Sha256: 0de95fc0af880dbc81a2c0c4ef5e0aa9338eddcef25cae6fae1dcb06a4357e64
Contents?: true
Size: 951 Bytes
Versions: 35
Compression:
Stored size: 951 Bytes
Contents
class OTRS::Ticket::State < OTRS::Ticket def self.set_accessor(key) attr_accessor key.to_sym end def persisted? false end def initialize(attributes = {}) attributes.each do |name, value| OTRS::Ticket.set_accessor(name.to_s.underscore) send("#{name.to_s.underscore.to_sym}=", value) end end def self.all data = { 'UserID' => 1 } params = { :object => 'StateObject', :method => 'StateList', :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