Parent

Methods

Class/Module Index [+]

Quicksearch

Lecturer

Schema Information

Table name: lecturers

id         :integer          not null, primary key
name       :string(255)
email      :string(255)
oid        :integer
picture    :string(255)
created_at :datetime         not null
updated_at :datetime         not null

Public Instance Methods

load_tissdata() click to toggle source
# File app/models/lecturer.rb, line 21
def load_tissdata
  url= "https://tiss.tuwien.ac.at/adressbuch/adressbuch/person_via_oid/"+self.oid.to_s+".xml"
  hash=Hash.from_xml(open(url).read)["tuvienna"]
  self.name=hash["person"]["firstname"]+" "+hash["person"]["lastname"]
  if hash["person"]["employee"]["employment"].is_a? Array
 self.email= hash["person"]["employee"]["employment"].first["emails"]["email"].first
  else
    self.email= hash["person"]["employee"]["employment"]["emails"]["email"].first
  end
  self.link= "https://tiss.tuwien.ac.at/adressbuch/adressbuch/person_via_oid/"+self.oid.to_s
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.