Class: SakaiInfo::AliasProperty

Inherits:
Object
  • Object
show all
Defined in:
lib/sakai-info/alias.rb

Class Method Summary collapse

Class Method Details

.find_by_alias_id(id) ⇒ Object



127
128
129
130
131
132
133
134
# File 'lib/sakai-info/alias.rb', line 127

def self.find_by_alias_id(id)
  properties = {}
  DB.connect[:sakai_alias_property].
    where(:alias_id => id).all.each do |row|
    properties[row[:name]] = row[:value].read
  end
  return properties
end

.get(id, property_name) ⇒ Object



117
118
119
120
121
122
123
124
125
# File 'lib/sakai-info/alias.rb', line 117

def self.get(id, property_name)
  row = DB.connect[:sakai_alias_property].
    filter(:alias_id => id, :name => property_name).first
  if row.nil?
    nil
  else
    row[:value].read
  end
end