From f3f6ec424f8b30befe68f62d44f5c76f82f34f77 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Jan 2014 16:11:46 -0800 Subject: [PATCH] :memo: Mark Pasteboard class as public --- src/pasteboard.coffee | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/pasteboard.coffee b/src/pasteboard.coffee index 92d808395..2f97333d8 100644 --- a/src/pasteboard.coffee +++ b/src/pasteboard.coffee @@ -1,7 +1,9 @@ clipboard = require 'clipboard' crypto = require 'crypto' -# Internal: Represents the clipboard used for copying and pasting in Atom. +# Public: Represents the clipboard used for copying and pasting in Atom. +# +# A pasteboard instance is always available under the `atom.pasteboard` global. module.exports = class Pasteboard signatureForMetadata: null @@ -14,18 +16,19 @@ class Pasteboard md5: (text) -> crypto.createHash('md5').update(text, 'utf8').digest('hex') - # Saves from the clipboard. + # Public: Write the given text to the clipboard. # - # text - A {String} to store - # metadata - An object of additional info to associate with the text + # text - A {String} to store. + # metadata - An {Object} of additional info to associate with the text. write: (text, metadata) -> @signatureForMetadata = @md5(text) @metadata = metadata clipboard.writeText(text) - # Loads from the clipboard. + # Public: Read the text from the clipboard. # - # Returns an {Array}. The first index is the saved text, and the second is any metadata associated with the text. + # Returns an {Array}. The first element is the saved text and the second is + # any metadata associated with the text. read: -> text = clipboard.readText() value = [text]