Method: Osm::Section#set_notepad

Defined in:
lib/osm/section.rb

#set_notepad(api, content) ⇒ Boolean

Set the section’s notepad in OSM

Parameters:

  • api (Osm::Api)

    The api to use to make the request

  • content (String)

    The content of the notepad

Returns:

  • (Boolean)

    whether the notepad was sucessfully updated



324
325
326
327
328
329
330
331
332
333
# File 'lib/osm/section.rb', line 324

def set_notepad(api, content)
  require_access_to_section(api, self)
  data = api.perform_query("users.php?action=updateNotepad&sectionid=#{id}", {'value' => content})

  if data.is_a?(Hash) && data['ok'] # Success
    cache_write(api, ['notepad', id], content)
    return true
  end
  return false
end