Sha256: af7d29af2785b7162a97d3671516197e9a1e0ecb37fdb09cf43d07189508cc17

Contents?: true

Size: 710 Bytes

Versions: 19

Compression:

Stored size: 710 Bytes

Contents

class OTRS::ConfigItem::Definition < OTRS::ConfigItem

  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)
      send("#{name.to_sym}=", value)
    end
  end

  def self.find(id)
    data = { 'DefinitionID' => id }
    params = { :object => 'ConfigItemObject', :method => 'DefinitionGet', :data => data }
    a = connect(params).first
    new(a)
  end

  def self.find_by_class_id(id)
    data = { 'ClassID' => id }
    params = { :object => 'ConfigItemObject', :method => 'DefinitionGet', :data => data }
    a = connect(params).first
    new(a)
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
otrs_connector-0.5.19 lib/otrs_connector/config_item/definition.rb
otrs_connector-0.5.18 lib/otrs_connector/config_item/definition.rb
otrs_connector-0.5.17 lib/otrs_connector/config_item/definition.rb
otrs_connector-0.5.16 lib/otrs_connector/config_item/definition.rb
otrs_connector-0.5.15 lib/otrs_connector/config_item/definition.rb
otrs_connector-0.5.14 lib/otrs_connector/config_item/definition.rb
otrs_connector-0.5.13 lib/otrs/config_item/definition.rb
otrs_connector-0.5.12 lib/otrs/config_item/definition.rb
otrs_connector-0.5.11 lib/otrs/config_item/definition.rb
otrs_connector-0.5.10 lib/otrs/config_item/definition.rb
otrs_connector-0.5.9 lib/otrs/config_item/definition.rb
otrs_connector-0.5.8 lib/otrs/config_item/definition.rb
otrs_connector-0.5.7 lib/otrs/config_item/definition.rb
otrs_connector-0.5.6 lib/otrs/config_item/definition.rb
otrs_connector-0.5.4 lib/otrs/config_item/definition.rb
otrs_connector-0.5.3 lib/otrs/config_item/definition.rb
otrs_connector-0.5.2 lib/otrs/config_item/definition.rb
otrs_connector-0.5.1 lib/otrs/config_item/definition.rb
otrs_connector-0.5.0 lib/otrs/config_item/definition.rb