Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix #put documentation

  • Loading branch information...
commit 0b3c820651cb6a83e90ad177062eb12f228e146b 1 parent 1293920
@drbrain authored
Showing with 9 additions and 8 deletions.
  1. +8 −7 lib/pasteboard.rb
  2. +1 −1  sample/dump.rb
View
15 lib/pasteboard.rb
@@ -171,21 +171,22 @@ def inspect # :nodoc:
end
##
- # Clears the pasteboard and adds +item+ to the pasteboard with +id+.
+ # Clears the pasteboard and adds +items+ to the pasteboard. Each item is
+ # added with a consecutive id starting at 0.
#
- # +item+ must be an Enumerable with pairs of item flavors and items. For
+ # An item must be an Enumerable with pairs of item flavors and items. For
# example:
#
# item = [
- # ['public.tiff', tiff],
- # ['public.url', url],
- # ['public.url-name', url],
- # ['public.utf8-plain-text', url]
+ # [Pasteboard::Type::TIFF, tiff],
+ # [Pasteboard::Type::URL, url],
+ # [Pasteboard::Type::URL_NAME, url],
+ # [Pasteboard::Type::UTF_8, url],
# ]
#
# pasteboard.put item
#
- # The pasteboard considers items added earlier in the list to have a higher
+ # The pasteboard considers flavors added earlier in an item to have a higher
# preference.
def put *items
View
2  sample/dump.rb
@@ -4,7 +4,7 @@
pb = Pasteboard.new
pb.each.with_index do |item, index|
- puts "item #{index}"
+ puts "item #{index} id #{pb.get_item_identifier index + 1}"
item.map do |flavor, data|
puts "flavor: #{flavor}"
puts "encoding: #{data.encoding} valid: #{data.valid_encoding?}" if
Please sign in to comment.
Something went wrong with that request. Please try again.