Class: SakaiInfo::ToolProperty
- Inherits:
-
Object
- Object
- SakaiInfo::ToolProperty
- Defined in:
- lib/sakai-info/tool.rb
Class Method Summary collapse
Class Method Details
.find_by_tool_id(tool_id) ⇒ Object
111 112 113 114 115 116 117 118 |
# File 'lib/sakai-info/tool.rb', line 111 def self.find_by_tool_id(tool_id) properties = {} DB.connect[:sakai_site_tool_property]. where(:tool_id => tool_id).all.each do |row| properties[row[:name]] = row[:value].read end return properties end |
.get(tool_id, property_name) ⇒ Object
101 102 103 104 105 106 107 108 109 |
# File 'lib/sakai-info/tool.rb', line 101 def self.get(tool_id, property_name) row = DB.connect[:sakai_site_tool_property]. filter(:tool_id => tool_id, :name => property_name).first if row.nil? nil else row[:value].read end end |