Method: Osm::Section#get_notepad
- Defined in:
- lib/osm/section.rb
#get_notepad(api, options = {}) ⇒ String
Get the section’s notepad from OSM
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 |
# File 'lib/osm/section.rb', line 300 def get_notepad(api, ={}) require_access_to_section(api, self, ) cache_key = ['notepad', id] if ![:no_cache] && cache_exist?(api, cache_key) && can_access_section?(api, self.id) return cache_read(api, cache_key) end notepads = api.perform_query('api.php?action=getNotepads') return '' unless notepads.is_a?(Hash) notepad = '' notepads.each do |key, value| cache_write(api, ['notepad', key.to_i], value) notepad = value if key.to_i == id end return notepad end |