class StickyNotifications::Note
Responsible for initiating note creation.
Public Instance Methods
create(message_text, title_text)
click to toggle source
@param text [String] text to be used as reminder @return [Nil] Calls Sticky Notifications URL scheme in order to
initiate creation of sticky notification.
# File lib/stickynotifications/note.rb, line 10 def create(message_text, title_text) message = escape(message_text) title = escape(title_text) `open "sticky-notifications://note?title=#{title}&message=#{message}"` end
escape(string_to_escape)
click to toggle source
Escapes the Sticky Notification text for URLs. URI produces %20 for spaces instead of CGI's +. @param string_to_escape [String] the text to be escaped @return [String] parsed URL
# File lib/stickynotifications/note.rb, line 20 def escape(string_to_escape) URI.escape(string_to_escape) end