Class: ArchivePrivateOpen
- Defined in:
- lib/archive_private_open.rb
Constant Summary collapse
- FILE_NAME =
'private'
Constants inherited from Archive
Archive::EXTENSION_FILE, Archive::FILE_PATH_KEYS, Archive::MODE_WRITE, Archive::ROOT_PATH_FILE
Instance Attribute Summary
Attributes inherited from Archive
Instance Method Summary collapse
-
#initialize ⇒ ArchivePrivateOpen
constructor
A new instance of ArchivePrivateOpen.
- #read ⇒ Object
- #write(text) ⇒ Object
Methods inherited from Archive
#decode, #encode, #full_name, #set_name
Constructor Details
#initialize ⇒ ArchivePrivateOpen
Returns a new instance of ArchivePrivateOpen.
5 6 7 |
# File 'lib/archive_private_open.rb', line 5 def initialize set_name(FILE_NAME) end |
Instance Method Details
#read ⇒ Object
9 10 11 12 |
# File 'lib/archive_private_open.rb', line 9 def read file = File.open full_name file end |
#write(text) ⇒ Object
14 15 16 17 18 |
# File 'lib/archive_private_open.rb', line 14 def write(text) file = File.open(full_name, Archive::MODE_WRITE) file.puts text file.close end |