Module: Clipboard::File
Constant Summary collapse
- FILE =
::File.("~/.clipboard")
Instance Method Summary collapse
Methods included from Implementation
Instance Method Details
#copy(data) ⇒ Object
12 13 14 15 16 |
# File 'lib/clipboard/file.rb', line 12 def copy(data, **) ::File.open(FILE, 'w', 0o0600) { |f| f.write(data) } rescue '' true end |
#paste(_ = nil) ⇒ Object
18 19 20 |
# File 'lib/clipboard/file.rb', line 18 def paste(_ = nil, **) ::File.read(FILE) rescue '' end |